Sync directories without too much overhead
cron + rsync
Use rsync to sync the folders, and cron to schedule the backups. You can open up your cron table (list of scheduled commands) with crontab -e
. First you can create your backup with:
rsync -a ~/Documents <backup folder path>
This will create a backup named "Documents" in the directory you specify. Then you can schedule this command to run at certain times with cron. For example:
0 12 * * * rsync -a ~/Documents <backup folder path>
This will backup your Documents folder to the backup folder path every day at noon. The format is:
# ┌───────────── minute (0 - 59)
# │ ┌───────────── hour (0 - 23)
# │ │ ┌───────────── day of the month (1 - 31)
# │ │ │ ┌───────────── month (1 - 12)
# │ │ │ │ ┌───────────── day of the week (0 - 6) (Sunday to Saturday;
# │ │ │ │ │ 7 is also Sunday on some systems)
# │ │ │ │ │
# │ │ │ │ │
# * * * * * <command to execute>
An asterisk means the task will run for every value of that time interval. So leaving all the asterisks would make it run every minute of every hour of every day of every month for every day of the week. In the example command I wrote earlier it would run at minute 0 of hour 12 (noon) of every day of every month for every day of the week.
It detects and updates only the edited, deleted, or added files so it will be very fast once you have already backed up the folder once.