Scheduling backups under Linux using the cron service

To automate backups, you can use the cron service familiar to many UNIX users.

Example

Let’s assume that you need to back up a volume regularly. A full backup has to be created weekly, supported by incremental backups created daily.

Use the list disks command to obtain the necessary volume number. For example, the volume number is 2-1.

Create two executable files for the daily and weekly backup (for example, abr.cron) and place them into the /etc/cron.daily and /etc/cron.weekly directories, respectively.

To initiate weekly full backups of volume 2-1, add the following line to the /etc/cron.weekly/abr.cron file:

#!/bin/bash
acrocmd backup disk --volume=2-1 --loc=/mnt/my_archives/my_host --arc=my_archive

where /mnt/my_archives/my_host is the path to the backup location.

The second abr.cron file is needed to initiate daily incremental backups.

#!/bin/bash
acrocmd backup disk --volume=2-1 --backuptype=incremental --loc=/mnt/my_archives/my_host --arc=my_archive

For more information, see Help of the cron service.