Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Question about crontab

by Anonymous Monk
on Jan 23, 2008 at 19:28 UTC ( [id://663863]=perlquestion: print w/replies, xml ) Need Help??

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I am trying to run a cron every Tuesday at midnight for the next five months. Last night though my cron ran...and I got into trouble at work. Can someone help me correct this crontab?

0 0 * 1-5 3 perl weeklycron.pl >>mylog.log

Replies are listed 'Best First'.
Re: Question about crontab
by philcrow (Priest) on Jan 23, 2008 at 19:53 UTC
    I think your day of week is off by one. Tuesday is 2, since Sunday is 0. You can use names, which are a bit more readable. At least, that's what my man page says on Ubuntu.

    Phil

    The Gantry Web Framework Book is now available.
      That might be a "midnight" ambiguity.

      Actually, I avoid running cron jobs directly on the hour (or small fractions thereof). Too many other people schedule their jobs that way, and it leads to load average spikes at those times. Maybe it's time to update cron with load balancing heuristics.

Re: Question about crontab
by pc88mxer (Vicar) on Jan 23, 2008 at 19:39 UTC
    I'm sure need to fully qualify your path names:

    0 0 * 1-5 3 /usr/bin/perl /where/is/your/script/weeklycron.pl >>/same/ +problem/here/mylog.log

    What other trouble did you get informed about?

Re: Question about crontab
by igelkott (Priest) on Jan 23, 2008 at 20:41 UTC
    After fixing the immediate problems cited above, you may also check if that logfile needs to be rotated.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://663863]
Approved by NetWallah
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (2)
As of 2024-04-26 05:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found