rsync.md (885B)
1 # Rsync 2 3 Notes on backups with rsync 4 5 Rsync is the best way to backup a folder to another folder. This is especially useful when mounting another drive and then setting up a backup system to backup a folder to that drive. 6 7 Usage: rsync -av --delete /home /srv/backup 8 9 The above command states to use archive mode to preserve permissions, v for verbose mode (optional), --delete says delete any files in the destination that don't exist in the source. We then specify the folder to sync and the location to sync it to. 10 11 I have this aliased to backup in my bashrc with the following line: 12 13 ```bash 14 alias backup='sudo rsync -av --delete /home/ /srv/backup' 15 ``` 16 17 it might make sense to remove the path stuff, but meh I don't plan on moving stuff around. Realistically, I might also want to create a systemd service to do this, but that seems like too much work for it to be worthwhile.