Mailinglist Archive: opensuse (3349 mails)

< Previous Next >
Re: [SLE] 9.3 cron.daily run time [SOLVED]
  • From: Randall R Schulz <rschulz@xxxxxxxxx>
  • Date: Fri, 6 May 2005 10:33:17 -0700
  • Message-id: <200505061033.17403.rschulz@xxxxxxxxx>
Anders,

On Saturday 07 May 2005 08:51, Anders Johansson wrote:
> On Saturday 07 May 2005 17:39, Scott Leighton wrote:
> ...
>
> > touch -t 200505070500 cron.daily
> >
> > Worked like a charm.
>
> I don't think so. That unfortunately doesn't seem to set the correct
> time stamp. Try
>
> find /var/spool/cron/lastrun -name cron.daily -printf "%c\n"

I'm fond of the "stat" command for this sort of thing.


> The timestamp you see there is the one that will control when it's
> run.
>
> So far, the only way I've found to do it correctly is to do
>
> at 5am
>
> > rm /var/spool/cron/lastrun/cron.daily
> > touch /var/spool/cron/lastrun/cron.daily
> > <ctrl-D>

This, of course, hinges on your definition of "correctly." I'm sure this
will make some cringe (myself included), but I did it and it seemed not
to cause anything catastrophic:

% rm /var/spool/cron/lastrun/cron.daily; \
date 050604002005.00; \
touch /var/spool/cron/lastrun/cron.daily; \
date 050610252005.00
Fri May 6 04:00:00 PDT 2005
Fri May 6 10:25:00 PDT 2005

Of course, you have to choose the second date to correspond with the
instant at which you plan to hit return and launch these commands.

It does have the desired effect:

% stat \
-c $'Access: %x\nModify: %y\nChange: %z\n' \
/var/spool/cron/lastrun/cron.daily
Access: 2005-05-06 04:00:00.017178085 -0700
Modify: 2005-05-06 04:00:00.017178085 -0700
Change: 2005-05-06 04:00:00.017178085 -0700


Randall Schulz

< Previous Next >
Follow Ups