Skip to content

Instantly share code, notes, and snippets.

@wouterds
Last active March 25, 2021 12:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wouterds/2589a898e83db2e9f0b66514e547dde4 to your computer and use it in GitHub Desktop.
Save wouterds/2589a898e83db2e9f0b66514e547dde4 to your computer and use it in GitHub Desktop.
rsync backup script
#!/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