Misc Daily/Nightly jobs

These are descriptions and cron entries for other various daily and nightly jobs that run against our servers.

Processes:
Crimson Spacelog
Sybping Server monitor
Update Statistics/sp_recompile
Nightly swatch review of update statistics/sp_recompile output
Log Rotations
Transaction Log cleanup
Nightly Swatch Restart

Crimson spacelog

A perl script on degas scrolls through the databases every 1/2 hour executing a "sp_spaceused syslogs" in each database and interpreting the output. If the log reaches 1000k, email is sent

(sybase's cron on degas)
0,30 * * * * /usr/local/sybase/spacelog.pl

back to top

Sybping Server monitor

Every 5 minutes, /export/syb_ops/misc.sybping.pl runs, which performs a socket-based connection to the server port each of our Sybase servers is configured to listen on. If the port fails a connect, we email a "down server" message.

(sybase's cron on max):
0,5,10,15,20,25,30,35,40,45,50,55 * * * * /export/syb_ops/misc/sybmonitor.sh

back to top

Update Statistics/sp_recompile jobs

We run two Sybase maintenance operations nightly on all supported servers: update statistics and sp_recompile. Update statistics updates the information in a table that the optimizer uses to run the most efficient query. sp_recompile tells the server to recompile every stored procedures and trigger the next time it executes, generally to take advantage of updated statistics. (nightly.sh is a front end to max:/export/syb_ops/nightly/nightly.pl)

The output of these jobs is written to
max:/export/syb_ops/nightly/nightly_[server].out

(sybase's cron on max)
0 4 * * * /export/syb_ops/nightly/nightly.sh

back to top

Swatch review of output files of Update Statistics/sp_recompile

Swatch is specifically called to review output files of these update statistics and sp_recompile jobs for errors symptomatic of other problems. This is also mentioned on the Swatch page under the non-perpetual topic.

(sybase's cron on max)
0 8 * * * /export/syb_ops/swatch/nightly_swatch.sh

back to top

Log Rotation

This process rotates logs to log.X where X is the number associated with the age (1=youngest, 7=oldest). Needed because dali's prod11 backup server log, degas's crimson sybase errorlog and the datatools logs on degas and dali grow quickly

(sybase's cron on dali)
30 6 * * * /export/datatools/scripts/rotate_logs.sh

(sybase's cron on degas)
30 6 * * * /usr/sybase.d/datatools/scripts/rotate_logs.sh

back to top

Transaction file cleanup

This script cleans up transaction log dumps based on success of nightly backup. With the advent of SQL backtrack, no mechanism exists to cleanup these files unless coded.

(sybase's cron on dali)
30 23 * * * /export/datatools/scripts/cleanup_backup.sh

(sybase's cron on degas)
30 23 * * * /usr/sybase.d/datatools/scripts/cleanup_backup.sh

back to top

Restart of perpetual swatch monitors

This process is needed b/c of log rotation. If you rotate the logs, swatch (unless restarted) continues to monitor old log. This is explained in the last question of the faq section of the swatch page. We don't restart any logs on pop or max because nothing in their configurations causes large log files.

(sybase's cron on dali)
45 6 * * * /u/sybase11/swatch/restart.sh

(sybase's cron on degas)
45 6 * * * /usr/sybase/swatch/restart.sh


back to top