Created
March 4, 2009 22:12
-
-
Save seven1m/74043 to your computer and use it in GitHub Desktop.
This file contains hidden or 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/sh | |
# rotating snapshotted backup | |
src=/my/stuff | |
dest=/var/backup | |
today=`date +%a` | |
yesterday=`date -d yesterday +%a` | |
mkdir -p $dest/$yesterday # in case it doesn't exist yet | |
rm -rf $dest/$today # I think this might be necessary -- not sure | |
cp -al $dest/$yesterday $dest/$today | |
rsync -ra --delete $src/* $dest/$today |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment