LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE
User Name
Password
SUSE / openSUSE This Forum is for the discussion of Suse Linux.

Notices


Reply
  Search this Thread
Old 04-30-2005, 11:11 AM   #1
juli
LQ Newbie
 
Registered: Apr 2005
Location: Denmark
Distribution: suse 9.1, debian
Posts: 5

Rep: Reputation: 0
anacron startscript


Hallo,
im working with suse 9.1 and I have organized my backups with cron. As the PC is not running 24/7 I would like to use anacron to catch up the missing jobs.
When I start anacron manually with

Code:
/usr/sbin/anacron -t /etc/anacrontab
the var/log/messages shows:

Code:
Apr 30 15:42:53 dhcppc0 anacron[8932]: Anacron 2.3 started on 2005-04-30
Apr 30 15:42:53 dhcppc0 anacron[8932]: Will run job `cron.daily' in 5 min.
Apr 30 15:42:53 dhcppc0 anacron[8932]: Will run job `cron.weekly' in 10 min.
Apr 30 15:42:53 dhcppc0 anacron[8932]: Will run job `cron.monthly' in 15 min.
But the scripts in cron.daily, cron.weekly and cron.monthly are not getting started, not even when
I remove the timestamps in /var/spool/anacron and the timestamps cron is using in /var/spool/cron/lastrun as well. No effect what so ever.

My crontab:

Code:
SHELL=/bin/sh
PATH=/usr/bin:/usr/sbin:/sbin:/bin:/usr/lib/news/bin
MAILTO=root

-*/3 * * * *   root  test -x /usr/lib/cron/run-crons && /usr/lib/cron/run-crons >/dev/null 2>&1
47 12  * * *     root  rm -f /var/spool/cron/lastrun/cron.daily
30 17  * * 5     root  rm -f /var/spool/cron/lastrun/cron.weekly
00 18  29 4 *     root  rm -f /var/spool/cron/lastrun/cron.monthly
My anacrontab:

Code:
 SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

1	5	cron.daily       /etc/cron.daily
3	10	cron.weekly       /etc/cron.weekly
27	15	cron.monthly    /etc/cron.monthly
Has anybody an idea how to trigger the scripts with anacron. And another thing I am struggling with is, how to get anacron started at boot time as root. I have noticed that some distributions offer to start anacron by using the runlevel editor, but SuSE doesen't.

With best regards and thanks in advanced
Juergen
 
Old 05-01-2005, 12:25 PM   #2
abisko00
Senior Member
 
Registered: Mar 2004
Location: Munich
Distribution: SuSE, Ubuntu
Posts: 3,513

Rep: Reputation: 58
I am not familar with anacron, but what I understood from the documentation, anacrontab needs to contain scheduled commands. But /etc/cron.xy are directories. My guess would be that you have to address the cron script directly.
 
Old 05-01-2005, 02:51 PM   #3
juli
LQ Newbie
 
Registered: Apr 2005
Location: Denmark
Distribution: suse 9.1, debian
Posts: 5

Original Poster
Rep: Reputation: 0
The thing is, that the most distributions are using the program run-parts to get the scripts in the cron.daily directory executed.
Code:
02 4 * * * root run-parts /etc/cron.daily
SuSE comes with its own solution using run-crons, for example:
Code:
-*/5 * * * *   root  test -x /usr/lib/cron/run-crons && /usr/lib/cron/run-crons >/dev/null  2>&1
00 17  * * *     root  rm -f /var/spool/cron/lastrun/cron.daily
These lines fetch the scripts in the cron.daily directory at 17:00 h and get them executed.
Anacron, another little program - is watching, if there are some jobs left behind because the computer was not running for a day or so. My problem was, that I coudn't get anacron to do that job.
Thanks to @rshaw's post
http://www.linuxquestions.org/questions/showthread.php?s=&threadid=317393&highlight=boot+script
I could get anacron up and running correctly at boot time and everything is working fine right now.

All the best
Juergen
 
  


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
anacron script format kalahari875 Linux - Newbie 1 12-02-2005 09:21 PM
anacron not running CarLash Mandriva 0 05-25-2005 09:36 PM
Anacron problem sachinh Linux - General 0 02-09-2005 02:02 AM
cron / anacron / fcron Will Linux - General 3 11-09-2001 02:34 PM
Anacron no permission email Graanco Linux - Networking 0 05-29-2001 09:19 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE

All times are GMT -5. The time now is 10:37 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration