Advertisement
msjche

Crontab Backup

Dec 2nd, 2017
487
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. START=$(date +%s)
  4.  
  5. #rsync -avz -e --exclude={"/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found/*","/home/msjche/Downloads/*","/home/msjche/Dropbox/*","/home/msjche/Google\ Drive/","/home/msjche/MEGA"} ssh msjche@192.168.1.7:/media/Backup/Laptop /*
  6.  
  7. sudo rsync -aAXv --delete --exclude=/dev/* --exclude=/proc/* --exclude=/sys/* --exclude=/tmp/* --exclude=/run/* --exclude=/mnt/* --exclude=/media/* --exclude="swapfile" --exclude="lost+found" --exclude=".cache" --exclude=/home/*/Downloads --exclude=/home/*/VirtualBox\ VMs --exclude=".ecryptfs" --exclude=/home/*/Distros --exclude=/home/*/Documents --exclude=/home/*/Dropbox --exclude=/home/*/Google --exclude=/home/*/MEGA --exclude=/home/*/Gentoo --exclude=/home/*/Guitar --exclude=/home/*/Icons --exclude=/home/*/Laptop --exclude=/home/*/Lehigh --exclude=/home/*/Movies --exclude=/home/*/Music --exclude=/home/*/Podcasts --exclude=/home/*/Screencasts --exclude=/home/*/Scripts --exclude=/home/*/TV --exclude=/home/*/Videos --exclude=/home/*/.local/share/Steam --exclude=/home/*/.gvfs --exclude=/home/*/Wallpaper / /media/Data/Backups/Desktop_Backup/
  8.  
  9. FINISH=$(date +%s)
  10. echo "total time: $(( ($FINISH-$START) / 60 )) minutes, $(( ($FINISH-$START) % 60 )) seconds" | tee $1/"Backup from $(date '+%Y-%m-%d, %T, %A')"
  11. #echo "total time: $(( ($FINISH-$START) / 60 )) minutes, $(( ($FINISH-$START) % 60 )) seconds"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement