Debian

Automated backups with rsync

Create a shell script

nano /home/myusername/sync/backup_data.sh

with the following contents:

#!/bin/bash
rsync -r -t -v --progress --delete -s /source/folder/ /destination/backup/folder/

Make the file executable

chmod +x /home/myusername/sync/backup_data.sh

Test script

./backup_data.sh

Edit crontab

crontab -e

Add a new line entry to run script every e.g. five(5) minutes

*/5 * * * * /home/myusername/sync/backup_data.sh

Save and exit