From: Brehl, Blake (Blake.Brehl@anritsu.com)
Date: Wed Mar 12 2008 - 13:15:57 EST
Hi Admins,
I'd like to fire a job only on the last day of the month from crontab.
Using ksh and a crontab entry of
1 3 28-31 * * /apps/scripts/lastdayfire
and have the script figure out which day is the last of the month.
Any ideas?
Here's a sample script that runs only on the 1st 2 days of the month.
1 2 1-14 * * /apps/scripts/1st2mondaysrunit
#!/bin/ksh
# script name 1st2mondaysrunit
DAYOFWK=`date +"%Ou"`; export DAYOFWK
if [[ $DAYOFWK = 1 ]]
then /apps/scripts/1st2mondaysrunit
fi
Best Regards, Blake
Tru64UNIX 5.1A sp1
GS80
Blake Brehl
Sys Admin/DBA
Anritsu Company United States
Morgan Hill, CA
blake.brehl@anritsu.com
This archive was generated by hypermail 2.1.7 : Sat Apr 12 2008 - 10:50:37 EDT