homepage Welcome to WebmasterWorld Guest from 54.226.161.112
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Subscribe to WebmasterWorld

Home / Forums Index / Hardware and OS Related Technologies / Linux, Unix, and *nix like Operating Systems
Forum Library, Charter, Moderators: bakedjake

Linux, Unix, and *nix like Operating Systems Forum

    
How to set up specific time for cron job?
RonSolo




msg:3402226
 5:06 pm on Jul 23, 2007 (gmt 0)

I'm running on a Plesk 8 server, and I have two basic questions regarding the Crontab:

1. How do I specify a specific time for a cron job to run? For example, to run at 10:30 AM every day?

2. If I have a cron job that is set to run every day, but without any time specified, what time will the job actually run?

Thanks,
Ron

 

phranque




msg:3402301
 6:35 pm on Jul 23, 2007 (gmt 0)

1 - daily@10:30am:
30 10 * * * /bin/sh /path/to/daily/command

2 - what do you mean by "without any time specified"?
if you mean the column is set "*" that means "every occurrence" for that column such as "every minute" or "every day".

RonSolo




msg:3402306
 6:40 pm on Jul 23, 2007 (gmt 0)

Sorry if I wasn't clear.

If I set the cron to run daily, I would use the "*". My question is, when does the job actually run? For example, does it run at midnight?

Thanks,
Ron

phranque




msg:3402318
 6:57 pm on Jul 23, 2007 (gmt 0)

If I set the cron to run daily, I would use the "*". My question is, when does the job actually run? For example, does it run at midnight?

which column are you putting the "*" in?
if it's in the 3rd and/or 5th columns it will run every day of the month and/or every day of the week.
the time(s) it runs depends on what's in the 1st and 2nd columns...

RonSolo




msg:3402329
 7:21 pm on Jul 23, 2007 (gmt 0)

At first, I had the following:
0 0 * * *
to run the job every day of the week/month without a specific time.

I also tried: 0 15 * * *
to run the job every day at 15:00 hours. But for some reason the job did not run.

I wasn't sure if I have to specify an actual time to run a cron job daily. If I want a job to run daily, do I still need to specify a an actual time for the job to run?

Thanks,
Ron

phranque




msg:3402395
 8:33 pm on Jul 23, 2007 (gmt 0)

At first, I had the following:
0 0 * * *
to run the job every day of the week/month without a specific time.

00:00 is a specific time.
this means run every day at midnight.

I also tried: 0 15 * * *
to run the job every day at 15:00 hours. But for some reason the job did not run.

this should have worked.
did you try a simple command?

I wasn't sure if I have to specify an actual time to run a cron job daily. If I want a job to run daily, do I still need to specify a an actual time for the job to run?

yes.

RonSolo




msg:3402401
 8:36 pm on Jul 23, 2007 (gmt 0)

Thanks, Phranque.
I understand it better now. I do have two other cron jobs running successfully (one is every 5 minutes and one is every hour), so I don't know why this particular script isn't running. I'll have to look into it.

Thanks,
Ron

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Hardware and OS Related Technologies / Linux, Unix, and *nix like Operating Systems
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved