Skip to content

Instantly share code, notes, and snippets.

@ArnonEilat
Last active December 21, 2019 20:49
Show Gist options
  • Save ArnonEilat/c1a1996dd7517f9c57ba to your computer and use it in GitHub Desktop.
Save ArnonEilat/c1a1996dd7517f9c57ba to your computer and use it in GitHub Desktop.
Backup using rsync
#!/bin/bash
ex=''
ex=$ex" --exclude /media/userName/07174FCC5FED4B6F "
ex=$ex" --exclude .adobe "
ex=$ex" --exclude .cordova "
ex=$ex" --exclude .android "
ex=$ex" --exclude android-sdk-linux "
ex=$ex" --exclude tmp "
ex=$ex" --exclude .thumbnails "
ex=$ex" --exclude Dropbox "
ex=$ex" --exclude .dropbox-dist "
ex=$ex" --exclude .dropbox "
ex=$ex" --exclude .local "
ex=$ex" --exclude .eclipse "
ex=$ex" --exclude .npm "
ex=$ex" --exclude .GoIde1 "
ex=$ex" --exclude .electron "
ex=$ex" --exclude anaconda3 "
ex=$ex" --exclude .anaconda "
ex=$ex" --exclude .config "
ex=$ex" --exclude .cache "
ex=$ex" --exclude Downloads/Torrents "
ex=$ex" --exclude .meteor "
ex=$ex" --exclude .atom "
ex=$ex" --exclude .synaptic "
ex=$ex" --exclude .macromedia "
ex=$ex" --exclude .npm "
ex=$ex" --exclude .nvm "
ex=$ex" --exclude .node-gyp "
ex=$ex" --exclude snap "
ex=$ex" --exclude .yarn "
ex=$ex" --exclude .ipfs "
ex=$ex" --exclude .bitmonero "
ex=$ex" --exclude .nvm "
rsync -azthi --delete --progress $ex /home/userName/ /media/userName/07174FCC5FED4B6F/Backup
#!/bin/bash
BACKUP_LOCATION="/home/userName/Downloads/backup"
FOLDER_TO_BACKUP="/var/www/html/web"
rsync -aAXv $BACKUP_LOCATION/* $FOLDER_TO_BACKUP --delete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment