cron schedule fire only on last day of month

From: Brehl, Blake <Blake.Brehl_at_anritsu.com>
Date: Wed, 12 Mar 2008 11:15:57 -0700

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_at_anritsu.com
Received on Wed Mar 12 2008 - 18:38:03 NZDT

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:45 NZDT