From: "Brehl, Blake" <Blake.Brehl@anritsu.com>
To: tru64-unix-managers@ornl.gov
Subject: cron schedule fire only on last day of month
Date: Wed, 12 Mar 2008 11:15:57 -0700 [thread overview]
Message-ID: <06919C2CEC2A8D46A394A43403A52CFD72C4CD@moh-exc-006.main.intgin.net> (raw)
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
reply other threads:[~2008-03-12 18:15 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox