There is a free script, that can automate the process of doing hot backups of Sybase -- sybback.sh. It is written in the Bourne shell, which is compatible with most Unix systems. By using GNU's config.guess script, the list of Unix platforms that it runs on is perhaps limitless. By setting various configuration options in a config file, sybback.conf, a wide range of hot backups can be accomplished. Sybback.sh supports these features:
How syback.sh worksStarting off, syback.sh sets up all the variables and paths it needs to run the backup. It uses config.guess to find out which flavor of Unix it is running on, and then sets what is appropriate for that system. After this, it then opens up its configuration file syback.conf. It locates this file in the directory where it was first started.Syback.sh reads each line of its configuration file, loading them into its memory. There are three different entry classes it can read - backup class entry, disk device entry, or tape device entry. The backup class entry defines what to backup, where to back it up to, when to back it up, who to back it up as, and certain required Sybase environmental variables. The tape and disk entries define which backup server to use and what device or directory to use on that server. Once all the entries are read in, syback.sh sequentially runs through each entry, and depending on the current time and the times specified in the backup class entry, it tries to run a backup. When it finds an entry that meets the time criteria, it outputs the entry. Next, it checks the entry and makes sure all the items in it are valid. The last of these checks uses the username and password entered to connect to the dataserver to be backed up. If any checks fail, a failure email is sent to the ADMIN entry defined in syback.conf. When the entry passes all checks, syback.sh creates a T-SQL dump command to back up of the databases selected to the appropriate backup server and devices. Installing syback.shPut the files syback.sh, syback.conf, config.guess, localpath.sh and rempath.sh into the same directory, then check the following value in the user-defined variables section at the top of the script. Change it to fit your environment:CONFIG_FILE Set this to the full pathname of the syback.conf configuration file. Configuring and Customizing oraback.shEdit syback.conf in your favorite text file editor. You will need to edit this file and add backup class entries and tape/disk device entries in order to configure your backup. The syback.conf file contains three type of entries, along with comments. The comment lines begin with the ‘#’ character. First, change the following parameters to the appropriate value for your environment:
The backup class lines define what type of backup should be run and when, along with any parameters required to run the backup. Here is the definition of a backup class line along with an explanation of each parameter. Review the comments in the syback.conf file to see examples of this entry. -c MM:HH:DOM:MN:DOW:SERVER_NAME:DUMP_TYPE:USER:PASSWORD:SYBASE:INTERFACES:LOG:DATABASE(S)_TO_INCLUDE:DATABASE(S)_TO_EXCLUDE:DEVICE_TYPE:
The MM, HH, DOM, MN, and DOW parameters are not yet used in this version of syback.sh specify when this particular dump should run. The appropriate value for each paramenter is listed below.
-t LOGICAL_NAME:SQL_SERVER:BACKUP_SERVER:DUMP_DEVICE:BLOCKSIZE:CAPACITY
Syback.sh will generate various messages as it runs. What you first will see is information about all the parameters that are set using the backup, tape and disk classes. Next, the output of each backup as it occurs will be displayed. Finally, when all the backups have been processed, if they backup was successful and a success email was selected in the backup class entry, then a success email containing the backup log will be sent administrator email address. If the backup was unsuccessful and failure email was selected, then a failure email containing the backup log will be sent to the administrator email address. Crontab entriesSyback.sh works slightly different than oraback.sh; syback.sh does not schedule itself to run. Instead, the user must either invoke syback.sh interactively, or set it up to run non-interactively with cron.Syback.sh tries to match the current time to a time entry in syback.conf. It then does the backup that is defined for that time. Here is an example of an entry using crontab: 0 2 * * * /opt/syback/syback.sh 2>&1 > /var/adm/syback/syback.last This entry says run syback.sh at 2:00am
every day and put all output into the file syback.last. Refer to
your operating systems manuals to find out how to schedule the automatic
running of syback.sh.
|