27.2. backup_gen

I have included backup_gen not because it shows how to back up directories, but because it is a good example of how to share common settings amongst other scripts.

The backup_gen is a backup script that reads in a default configuration file which is then used for a backup of the system. A user can alter the default settings if he or she wishes. This script is a good example of how different scripts can use the same settings or change them just for the script’s run time. When the script executes, it makes sure the source file (backup.defaults) is present. The script will exit if it cannot be found.

A screen header and the default settings are displayed. The user is asked if he or she wants to change any of the default settings. ...

Get Linux and Unix Shell Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.