Last active
March 25, 2021 12:28
-
-
Save wouterds/2589a898e83db2e9f0b66514e547dde4 to your computer and use it in GitHub Desktop.
rsync backup script
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 | |
RSYNC="/usr/bin/sudo /usr/bin/rsync" | |
DTIME=`date +"%Y%m%d"` | |
LOCATION=/mnt/backups/servers/$1/$DTIME | |
mkdir -p $LOCATION | |
rsync -avx \ | |
--rsync-path="$RSYNC" \ | |
--numeric-ids \ | |
--delete \ | |
--progress \ | |
--exclude="node_nodules/" \ | |
wouterds@$1:/code $LOCATION |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment