sergio_educacionit

mariadb_incremental-sshkey.sh

Oct 27th, 2025 (edited)
20
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. bkp_server=192.168.0.53
  4. bkp_user=admin
  5. bkp_path=/home/admin/sysadmin_incremental/mysql/
  6.  
  7.  
  8. # Detener el servicio
  9.  
  10. systemctl stop mariadb.service
  11.  
  12.  
  13. # permisos, propietarios y grupos
  14.  
  15. ls -l /var/lib/mysql > /var/lib/mysql/file_permissions.txt
  16.  
  17. # Envio de archivos
  18.  
  19. rsync -e "ssh -i $HOME/.ssh/id_rsa" \
  20. -av /var/lib/mysql/ \
  21. $bkp_user@$bkp_server:$bkp_path
  22.  
  23.  
  24. # Iniciar servicio
  25.  
  26. systemctl start mariadb.service
  27.  
Advertisement
Add Comment
Please, Sign In to add comment