Created
May 15, 2015 22:19
-
-
Save egermano/241810b26878a3c0ab32 to your computer and use it in GitHub Desktop.
Cloud time machine
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 | |
date=`date "+%Y-%m-%dT%H_%M_%S"` | |
HOME=/Users/path | |
rsync -azP \ | |
--delete \ | |
--delete-excluded \ | |
--exclude-from=$HOME/.Trash \ | |
--exclude-from=$HOME/.cache \ | |
--exclude-from=$HOME/Dropbox \ | |
--exclude-from=$HOME/odrive \ | |
--link-dest=../current \ | |
$HOME [email protected]:~/backups/Inesplorato/incomplete_back-$date \ | |
&& ssh [email protected] \ | |
"mv ~/backups/Inesplorato/incomplete_back-$date ~/backups/back-$date \ | |
&& rm -f ~/backups/Inesplorato/current \ | |
&& ln -s back-$date ~/backups/Inesplorato/current" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment