This procedure describes how to develop and use a script to perform a weekly full backup and daily incremental backups of user files. The script included in this procedure is intended only as a model and should be carefully tailored to the needs of the specific site.
This procedure describes how to write a crontab script that you can pass to the cron command for execution. The script backs up two user file systems, /home/plan and /home/run, on Monday through Saturday nights. Both file systems are backed up on one tape, and each morning a new tape is inserted for the next night. The Monday night backups are full archives (level 0). The backups on Tuesday through Saturday are incremental backups.
crontab -e
min hr day/mo mo/yr day/wk shell command 0 2 * * 1 backup -0 -uf /dev/rmt0.1 /home/planThe command line shown assumes that personnel at the site are available to respond to prompts when appropriate. The -0 (zero) flag for the backup command stands for level zero, or full backup. The -u flag updates the backup record in the /etc/dumpdates file and the f flag specifies the device name, a raw magnetic tape device 0.1 as in the example above. See "rmt Special File" in the AIX Version 4.3 Files Reference for information on the meaning of extension .1 and other extensions (1-7).
0 2 * * 1 backup -0 -uf/dev/rmt0.1 /home/plan 0 3 * * 1 backup -0 -uf/dev/rmt0.1 /home/run 0 2 * * 2 backup -1 -uf/dev/rmt0.1 /home/plan 0 3 * * 2 backup -1 -uf/dev/rmt0.1 /home/run 0 2 * * 3 backup -2 -uf/dev/rmt0.1 /home/plan 0 3 * * 3 backup -2 -uf/dev/rmt0.1 /home/run 0 2 * * 4 backup -3 -uf/dev/rmt0.1 /home/plan 0 3 * * 4 backup -3 -uf/dev/rmt0.1 /home/run 0 2 * * 5 backup -4 -uf/dev/rmt0.1 /home/plan 0 3 * * 5 backup -4 -uf/dev/rmt0.1 /home/run 0 2 * * 6 backup -5 -uf/dev/rmt0.1 /home/plan 0 3 * * 6 backup -5 -uf/dev/rmt0.1 /home/run