#!/bin/bash # # job-db-update.cron -- Cron job to run job-db-update on yesterday's PBS # accounting records. # Copyright 2006 Ohio Supercomputer Center # Revision info: # $HeadURL$ # $Revision$ # $Date$ # # Meant to be run nightly by cron: # 15 0 * * * * /usr/local/etc/job-db-update.cron # NOTE: the following only works with the GNU implementation of date export yesterday=$(date --date='1 day ago' +%Y%m%d) # ***EDIT ME*** to reflect the "system" name used in the DB export system=$(hostname) # ***EDIT ME*** to reflect the PBS spool location for this system export PBS_HOME=/var/spool/batch/pbs # ***EDIT ME*** to reflect where the pbstools scripts are installed export pbstools=/usr/local $pbstools/sbin/job-db-update -h $system $PBS_HOME/server_priv/accounting/$yesterday $pbstools/sbin/job-db-update-contacts -h $system $pbstools/sbin/fixup-nodect