[Ilugc] Cron settings

  • From: aparajit@xxxxxxxxx (Aparajit Raghavan)
  • Date: Mon May 16 18:25:05 2005

On 5/16/05, Binand Sethumadhavan <binand@xxxxxxxxx> wrote:

Looks to me this cannot be done from entirely within cron. I think the
best way is to run your script from cron every Saturday, and let the
script decide whether a particular Saturday is the last of the month
or not.

if [ `date +'%d'` = `cal | cut -d" " -f7 | grep '[0-9]' | tail -1` ];
then <your program> ; fi

Ugly but works.
Aparajit

Other related posts: