Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Crontab is used in Linux distributions to schedule jobs.  It can be scheduled for specific minute(s), hour(s), day(s), and so forth.  More information can be seen here. The Wikipedia article explains it fairly well also. For more information on the SSDT Supplied Scripts, see this page.

Crontab Basics

Look at existing crontab

Code Block
## to look at an existing crontab file
sudo crontab -l

Edit existing crontab

Code Block
##to edit/create a crontab file (use sudo to make it for root)
sudo crontab -e

##add any commands

Updating SSDT images

Pulling and applying ssdt supplied images on a daily basis is recommended.  On Ubuntu, crontab is used for this. First, update the ssdt utilities package, pull the image updates, and then apply the updates. See here for specific information on applying software updates. 

...

Code Block
0 2 * * 6   /ssdt/scripts/updates-cleanup.sh 2>&1 > /data/pilot/updates-cleanup.log

Automating Backups

USXS backup basics are described here.  In order to automate these backups, the exec-all-projects.sh script must be used along with the backup-usxs.sh script.

Code Block
## backup usps databases for running containers in the /data/pilot directory tree at 1:40 and append to the log file
## backup usas databases for running containers in the /data/pilot directory tree at 1:45 and append to the log file
40 1 * * *  /ssdt/scripts/exec-all-projects.sh /data/pilot /ssdt/scripts/backup-usps.sh 2>&1 >> /data/pilot/backup-usps.log
45 1 * * *  /ssdt/scripts/exec-all-projects.sh /data/pilot /ssdt/scripts/backup-usas.sh 2>&1 >> /data/pilot/backup-usas.log

Example of a full cron job

In this job, utilities updates are pulled daily at 1:00 a.m. Available release updates are pulled at 1:10 a.m. and applied at 1:30 a.m.  At 1:40 a.m., all usas databases for instances running in /data/pilot directory tree are backed up, and the usps ones are backed up at 1:45 a.m.  Image cleanup is performed every Saturday at 2:00 a.m.  With the exception of the cleanup log, dates are placed in the name of the logs.

...