Created
June 14, 2021 16:59
-
-
Save randomcamel/8e5a8f72a163236768267e9ca7ae4dc1 to your computer and use it in GitHub Desktop.
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/sh | |
# uses rsync's hard-link feature to mimic the function and structure of Apple's Time Machine. | |
# my server's name is 'shiny', which I evidently used to mount on /backup. | |
TARGET=/backup/shiny | |
date=`date "+%Y-%m-%dT%H:%M:%S"` | |
rsync --exclude=.AppleDouble -aCPv --link-dest=$TARGET/current $HOME $TARGET/back-$date | |
cd $TARGET | |
rm current | |
ln -s back-$date current | |
# I had this disabled, but it was a nice touch. | |
touch $TARGET/../.last-rsync |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment