LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-05-2005, 05:59 AM   #16
jordanthompson
Member
 
Registered: Oct 2004
Posts: 115

Original Poster
Rep: Reputation: 15

Thanks for the suggestion.
I found something nteresting.... I changed the cron.weekly line below and it ran for the first time last night. I am going to try changing the 0 to a 1 for now. Any other ideas?

I am running FC 2

# run-parts
01 * * * * root run-parts /etc/cron.hourly
02 4 * * * root run-parts /etc/cron.daily
02 2 * * * root run-parts /etc/cron.weekly
#22 4 * * 0 root run-parts /etc/cron.weekly
42 4 1 * * root run-parts /etc/cron.monthly
 
Old 01-05-2005, 12:32 PM   #17
wipe
Member
 
Registered: Jun 2004
Location: High Green
Distribution: Fedora Core 4
Posts: 180

Rep: Reputation: 30
I tested a weekly job by changing the day, hour and minute numbers so that it ran on the next minute (cron always checks if crontab's modification time has changed). It worked fine. I don't know about anacron though.

My crontab:
Code:
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/

# run-parts
01 * * * * root run-parts /etc/cron.hourly
02 4 * * * root run-parts /etc/cron.daily
22 4 * * 0 root run-parts /etc/cron.weekly
42 4 1 * * root run-parts /etc/cron.monthly
 
Old 01-05-2005, 09:35 PM   #18
jordanthompson
Member
 
Registered: Oct 2004
Posts: 115

Original Poster
Rep: Reputation: 15
This one works. The only thing that makes sense is the 0 for the day of the week was wrong. I checked the man page and it says that a 0 or a 7 will work there - I am guessing there is a problem with this.

Jordan

SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/

# run-parts
01 * * * * root run-parts /etc/cron.hourly
02 4 * * * root run-parts /etc/cron.daily
15 22 * * 3 root run-parts /etc/cron.weekly
#02 2 * * * root run-parts /etc/cron.weekly
#22 4 * * 0 root run-parts /etc/cron.weekly
42 4 1 * * root run-parts /etc/cron.monthly
 
Old 01-05-2005, 10:12 PM   #19
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 61
Quote:
22 4 * * 0 root run-parts /etc/cron.weekly
That should work if you have the machine running on Sunday night at 4:22am. If not, you would need to have anacron installed and running as that runs crons which were missed from downtime. Also, you could just change the weekly to a day and time when things are up and running.
 
Old 01-06-2005, 08:49 AM   #20
jordanthompson
Member
 
Registered: Oct 2004
Posts: 115

Original Poster
Rep: Reputation: 15
This machine is up and running 24/7 - the weekly cron never ran with:
22 4 * * 0 root run-parts /etc/cron.weekly

but it does (at lease it ran once!) with:
15 22 * * 3 root run-parts /etc/cron.weekly
 
Old 01-16-2005, 01:48 AM   #21
gannis
LQ Newbie
 
Registered: Jan 2005
Posts: 1

Rep: Reputation: 0
When did it execute?

I run Debian/Sarge with standard crontab file. It runs, but changing the day 0 to day 3 doesn't make the weekly part executing on wednesday - it runs on sunday morning!

-----------------------------------------------------------------------------------------------------
47 5 * * 3 root test -x /usr/sbin/anacron || run-parts --report /etc/cron.weekly
-----------------------------------------------------------------------------------------------------

I now changed to "monday" in the file to see what happens tomorrow.
 
Old 01-16-2005, 09:52 AM   #22
jordanthompson
Member
 
Registered: Oct 2004
Posts: 115

Original Poster
Rep: Reputation: 15
Interesting that you should ask today :-)
I got an email this morning at 4:50 saying the cron had run this morning. I believe it should have run at 10:15 PM EDT which translates to 3:15 GMT the next day...

It is possible that the job took an hour (it is taring and gzipping several large directories...) so that could explain the time differntial.

Hope this helps.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache crash on cron->logrotate (weekly) pezzer55 Linux - Software 7 09-30-2008 07:58 PM
how do I rsync & cron to fetch -current weekly? chess Slackware 3 09-11-2005 10:07 AM
Weekly Cron problem sopiaz57 Linux - General 2 11-15-2004 11:46 AM
trying to get cron to run naijaguy Linux - General 12 08-18-2004 05:32 PM
how to run this cron job ashley75 Linux - General 5 05-24-2004 11:20 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:23 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration