Created
April 10, 2017 19:54
-
-
Save brianpursley/9ce82dd5ea1c33ed162984c99a3a88ea to your computer and use it in GitHub Desktop.
Script to backup a folder (/share) and capture incremental changes since the last backup in a timestamp-named folder
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ts=`date +%Y%m%d_%H%M%S` | |
rsync -rtm --compare-dest=/mnt/usb1/backups/snapshot --modify-window=2 /share /mnt/usb1/backups/$ts | |
find /mnt/usb1/backups/$ts -type d -empty -delete | |
rsync -rt --delete --modify-window=2 /share /mnt/usb1/backups/snapshot |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment