SyP-

Bash backup v2

Aug 1st, 2020 (edited)
145
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. find $HOME -mtime -1 -exec cp -r {} $DEST-$DATE \;
  10.  
  11.  
  12. #cp -r $HOME $DEST-$DATE &&
  13.  
  14. tar czf /tmp/backup-$(date +%d-%m-%y_%M).tar.gz $DEST-$DATE
  15.  
  16. echo ""
  17. echo "Listando directorio de backup"
  18. echo ""
  19.  
  20. ls /tmp
  21.  
RAW Paste Data