Adding ability to remove backup logs over 7 days old
This commit is contained in:
parent
c5ba1e0cc7
commit
7bcec44bb8
1 changed files with 4 additions and 2 deletions
|
|
@ -27,10 +27,12 @@ fi
|
|||
|
||||
echo "Preparing to transfer differences in home directory to backup USB drive using rsync."
|
||||
|
||||
rsync -avzh --exclude '.cache' --exclude 'Videos' --exclude 'Nextloud' --exclude 'Downloads/isos' --exclude 'VirtualBox VMs' --exclude 'Sync' --exclude 'Downloads/torrents' --exclude '.local/share/Steam' --exclude 'Music' --progress --delete /home/tracey/Documents /media/tracey/Backup/tracey/Documents/ 2>&1 | tee $log_file
|
||||
rsync -avzh --exclude '.cache' --exclude 'Videos' --exclude 'Nextloud' --exclude 'Downloads/isos' --exclude 'VirtualBox VMs' --exclude 'Sync' --exclude 'Downloads/torrents' --exclude '.local/share/Steam' --exclude 'Music' --progress --delete /home/tracey/ /media/tracey/Backup/tracey/ 2>&1 | tee $log_file
|
||||
|
||||
echo ""
|
||||
echo "Backup Complete"
|
||||
echo "Log of this backup is in $log_file"
|
||||
echo ""
|
||||
echo "Now deleting backup logs over 7 days"
|
||||
echo "####"
|
||||
|
||||
find /home/tracey -iname 'usb-rsync-backup-*' -mtime +7 -exec rm {} \;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue