Advertisement
sergio_educacionit

backup_medio-cifrado.sh

Dec 22nd, 2022
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3.  
  4. # luksOpen /path/to/device i.e /dev/sdc1
  5. cryptsetup luksOpen /root/disk.img disco_cifrado
  6.  
  7. mount /dev/mapper/disco_cifrado /mnt || exit 1
  8.  
  9.  
  10.  
  11. read -p "Desea realizar el backup de /var/www a /mnt? y/n " resp
  12.  
  13. if [ $resp != "y" ];then
  14. exit 1
  15. else
  16. rsync -av /var/www/ /mnt
  17. fi
  18.  
  19.  
  20.  
  21.  
  22.  
  23. umount /dev/mapper/disco_cifrado
  24.  
  25. cryptsetup luksClose /dev/mapper/disco_cifrado
  26.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement