Created
May 30, 2015 09:52
-
-
Save jasemagee/0595d24099a1dac886dc to your computer and use it in GitHub Desktop.
Rsync to backup a directory (inc. sub directories) and ignore files/folders specified in an exclude file
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
# Command: | |
alias backup='rsync -av --delete --delete-excluded --exclude-from=/path/to/exclude/file /dir/to/backup/ /dir/backup/to/' | |
# -a archive mode. Shortcut to a bunch of other options typically used for archives. | |
# -v verbose. I run the command manually and want to see what is happening. | |
# --delete will remove files/folders from the backup target when deleted from the backup source | |
# --delete-excluded will remove files/folders previously backed up that have now been marked for exclusion | |
# Exclude file example (ignore rule per line): | |
# Downloads | |
# .cache | |
# .local/share/Steam/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment