Created
April 13, 2015 19:35
-
-
Save liefersfl/77cfca6b6566cf31547b to your computer and use it in GitHub Desktop.
Revisions
-
liefersfl created this gist
Apr 13, 2015 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,19 @@ #!/bin/bash HOME=/var/services/homes/backupchef SNAPSHOT_DIR=$HOME/backups/myserver LOG_DIR=$HOME/backups KEY_ID=$HOME/.ssh/id_rsa RM=/bin/rm; MV=/bin/mv; CP=/bin/cp; $RM -rf $SNAPSHOT_DIR/daily.6; $MV $SNAPSHOT_DIR/daily.5 $SNAPSHOT_DIR/daily.6; $MV $SNAPSHOT_DIR/daily.4 $SNAPSHOT_DIR/daily.5; $MV $SNAPSHOT_DIR/daily.3 $SNAPSHOT_DIR/daily.4; $MV $SNAPSHOT_DIR/daily.2 $SNAPSHOT_DIR/daily.3; $MV $SNAPSHOT_DIR/daily.1 $SNAPSHOT_DIR/daily.2; $MV $SNAPSHOT_DIR/daily.0 $SNAPSHOT_DIR/daily.1; cd $SNAPSHOT_DIR rsync -az -e "ssh -p 122 -i $KEY_ID" --delete --stats --link-dest=$SNAPSHOT_DIR/daily.1 root@myserver:/home $SNAPSHOT_DIR/daily.0