Skip to content

Instantly share code, notes, and snippets.

@wouterds

wouterds/backup.sh

Last active Mar 25, 2021
Embed
What would you like to do?
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