Skip to content

Instantly share code, notes, and snippets.

@kparrish
Created October 22, 2013 18:26
Show Gist options
  • Save kparrish/7105506 to your computer and use it in GitHub Desktop.
Save kparrish/7105506 to your computer and use it in GitHub Desktop.
Remote Backup
#!/bin/bash
# rsync backup, see www.linux.com/learn/tutorials/284789-writing-a-simple-bash-script-
SOURCEDIR1=/home/user
DESTDIR1=user@hostname:/path/to/folder
rsync -az --progress --exclude='*.bak' --rsh 'ssh ' $SOURCEDIR1 $DESTDIR1
@pavankulka
Copy link

Hi

What to do if you have multiple directories under SOURCEDIR ?

@kparrish
Copy link
Author

@pavankulka all the directories and files under SOURCEDIR will be synced.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment