SyP-

Bash backup

Aug 1st, 2020 (edited)
151
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2.  
  3. DATE=$(date +%d-%m-%y_%M)
  4. DEST=/tmp/backup
  5.  
  6.  
  7. mkdir -p $DEST-$DATE &&
  8.  
  9.  
  10. cp -r $HOME $DEST-$DATE &&
  11.  
  12. tar czf /tmp/backup-$(date +%d-%m-%y_%M).tar.gz $DEST-$DATE
  13.  
  14. echo ""
  15. echo "Listando directorio de backup"
  16. echo ""
  17.  
  18. ls /tmp
  19.  
RAW Paste Data