| 40 | Performing Incremental Daily Backups |
Building on the full backup script in the previous task, daily-backup.pl performs an incremental backup. You should run this incremental backup script at least daily, but you might run it more often if you’re extra paranoid.
The script loads the last_backed_up file created by the full backup, checks to see whether there are any new revisions in the repository, and backs up just those new revisions. If there have been no check-ins since the last full backup, the script exits early and doesn’t create an incremental backup. The script saves the last-backed-up revision back into last_backed_up so that future incremental backups work correctly too.
Running the script produces output such as the following: ...