LinuxQuestions.org
Review your favorite Linux distribution.
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 01-02-2007, 04:07 AM   #1
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629

Rep: Reputation: Disabled
cron not working from crontab nor form /etc/cron/cron.d. What did SuSE change?


Or did I overlook something?

My goal is to automate backups. I had tested rsnapshot for correct configuration (option -t) and tested it by hand starting rsnapshot with
Code:
rsnapshot hourly
rsnapshot daily
which resulted in the wanted backups.

Then as root I entered via "crontab -e":
Code:
0    */2  *    *    *    /usr/local/bin/rsnapshot hourly
50   23   *    *    *    /usr/local/bin/rsnapshot daily
40   23   1,8,15,22    *    *    /usr/local/bin/rsnapshot weekly
30   23   1    *    *    /usr/local/bin/rsnapshot monthly
The computer has been restarted since, lots of times -- nothing happened.

Next, as an alternative, I copied those crontab lines to a file in /etc/cron/cron.d (where also the beagle entry resides) and hoped for the best -- all in vain.

The time difference between my running of rsnapshot and the cron job is huge (months in fact), so the thing really should run -- but doesn't.

From the documentation I gathered that SuSE expects scripts in /etc/cron/cron.hourly - */daily etc. but how can I trigger rsnapshot from there at times like those in my crontab file? I mean I could just create a shell script with
Code:
/usr/local/bin/rsnapshot hourly
in the /etc/cron/cron.hourly directory but how to do it only every two hours as in
Code:
0    */2  *    *    *   /command/to/run
?

Since the experts are (hopefully ) here: where is the crontab-generated file located by the by? Didn't find it ... does it have a name with no "cron" in it?

Can i "nice" the command (at a time it is finally runnig as desired )?

Last edited by JZL240I-U; 01-04-2007 at 02:36 AM. Reason: option corrected
 
Old 01-02-2007, 01:50 PM   #2
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Can you get anything to run from a user's crontab (even just to send a basic message to the user)?
 
Old 01-02-2007, 02:13 PM   #3
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Actually another question (I don't claim to be a crontab expert - I just use it occasionally). Did it occur to you that this is possibly parameter passing problem, in that crontab thinks the parameter "hourly" for example is a parameter to crontab not rsnapshot (since this is where the output parameter would normally go for crontab entries)?

Why don't you create a simple shell file (say /root/rsnapshot.hourly.sh) that only has something like

Quote:
#!/bin/sh
/usr/local/bin/rsnapshot hourly
get that to work fine from the command line, and then try

0 */2 * * * /root/rsnapshot.hourly.sh

in crontab
 
Old 01-03-2007, 01:33 AM   #4
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629

Original Poster
Rep: Reputation: Disabled
Hi billymayday, thanks for answering. I haven't tried as user, as it is about a backup (among others of "/etc") I wanted to run "rsnapshot" as root, but I could try.

Your second post sounds very plausible. Could I quote in crontab? I mean, a lot of people will have needed something like this already so I'd guess it is provided for in crontab one just had to find out how . I'll try
Code:
0    */2  *    *    *    '/usr/local/bin/rsnapshot hourly'
and if it doesn't work your suggestion. I'll be back tomorrow with the results. Thanks again .

Last edited by JZL240I-U; 01-04-2007 at 02:37 AM. Reason: typo corrected
 
Old 01-03-2007, 02:57 AM   #5
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
You can edit crontab as root you know - root's a user too!
 
Old 01-03-2007, 03:03 AM   #6
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629

Original Poster
Rep: Reputation: Disabled
That is exactly what I did:
Quote:
Originally Posted by JZL240I-U
...Then as root I entered via "crontab -e":
Code:
0    */2  *    *    *    /usr/local/bin/rsnapshot hourly
50   23   *    *    *    /usr/local/bin/rsnapshot daily
40   23   1,8,15,22    *    *    /usr/local/bin/rsnapshot weekly
30   23   1    *    *    /usr/local/bin/rsnapshot monthly
...
I still think your suggestion concerning the parameter / quoting problem is probably close to the mark. Like I said, I'll try it tonight (sitting at a Win-box right now).

Last edited by JZL240I-U; 01-03-2007 at 03:05 AM.
 
Old 01-03-2007, 03:07 AM   #7
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Before you try any of this, can you check where rsnapshot lives in SuSe land?

I just yum'ed a copy onto a spare CentOS server and it's in /usr/bin not /usr/local/bin. Could easily be your problem.

Looking at the man page for rsnapshot, it looks like what you tried should wotk if the path is OK
 
Old 01-03-2007, 03:09 AM   #8
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629

Original Poster
Rep: Reputation: Disabled
Uuups. I'll have a look. Thanks a load .
 
Old 01-03-2007, 03:20 AM   #9
hameedkhan
LQ Newbie
 
Registered: Oct 2004
Location: Karachi, Pakistan
Distribution: Slackware, SuSe, Ubuntu, CentOS
Posts: 19

Rep: Reputation: 0
Quote:
Originally Posted by JZL240I-U

From the documentation I gathered that SuSE expects scripts in /etc/cron/cron.hourly - */daily etc. but how can I trigger rsnapshot from there at times like those in my crontab file? I mean I could just create a shell script with [/FONT]
Code:
/usr/local/bin/rsnapshot hourly
in the /etc/cron/cron.hourly directory but how to do it only every two hours as in
Code:
0    */2  *    *    *   /command/to/run
For SuSe 10 you can put your crontab entries in /root/bin/cron.daily.local. entries in /etc/cron.d/ are not run automatically at later time. and the entries added or edited by "crontab" command are locate in /var/spool/cron/tabs/ in files matching the usernames.

Don't put your entires in /etc/cron.* files because these scripts are overwritten when you update your system. Add your entries in above mentioned file.
 
Old 01-03-2007, 03:24 AM   #10
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629

Original Poster
Rep: Reputation: Disabled
Ah, something about SuSE internals, that's why I posted in the SuSE subforum . Thanks hameedkhan I'll give it a go.
 
Old 01-03-2007, 04:06 AM   #11
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Googling for suse rsnapshot showed me this:

http://rpmfind.net/linux/RPM/opensus...28.noarch.html

and in part it says

Quote:
Files

/etc/rsnapshot.conf
/etc/rsnapshot.conf.default
/usr/bin/rsnapshot
/usr/bin/rsnapshot-diff
/usr/share/doc/packages/rsnapshot
/usr/share/doc/packages/rsnapshot/AUTHORS
/usr/share/doc/packages/rsnapshot/COPYING
/usr/share/doc/packages/rsnapshot/ChangeLog
/usr/share/doc/packages/rsnapshot/INSTALL
/usr/share/doc/packages/rsnapshot/README
/usr/share/doc/packages/rsnapshot/TODO
/usr/share/man/man1/rsnapshot.1.gz
 
Old 01-04-2007, 01:57 AM   #12
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629

Original Poster
Rep: Reputation: Disabled
Hit and sunk

You did it billymayday it was the wrong path as you'd already correctly guessed. After deleting the "/local" part from it, everything works and no quoting needed either.

Oh, and I simply copied the paths from http://www.die.net/doc/linux/man/man1/rsnapshot.1.html so, other newbies beware -- generally the information is really good on that site which I commend, it was my error, not looking what my system did during install.

@hameedkhan right on, I found the entries in /var/spool/cron/tabs/ thanks for the information.

As to putting the entries into /root/bin/cron.daily.local etc. that would not have the desired effect (I think). You probably know that SuSE has a script which tests whether cron jobs were not executed during shutdown time and makes cron catch up on everything contained in /etc/cron/cron.hourly - *.daily - *.weekly. My box is a stand-alone workstation. Since I back up /etc it is not too much hassle to get it back after an update.

I'm thinking about using fcron now: http://fcron.free.fr/

How is beagle started by the way? Anybody knows technical details?

Last edited by JZL240I-U; 01-04-2007 at 06:30 AM. Reason: adding information
 
  


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
shell script using /etc/cron.hourly to execute cron.php file? rioguia Programming 3 06-11-2008 08:09 AM
Slackware's Cron Scheduler: I'm thinking maybe I need to put in a different cron? Old_Fogie Slackware 5 11-03-2006 06:25 AM
Can any one plz explain why/what for cron.d, cron.daily, cron.weekly etc are there. mavinashbabu Linux - Newbie 4 09-21-2006 01:50 PM
[cron][mdk9.1]cron deamon seems to ignore some task... yannrichet Linux - Newbie 5 06-26-2003 09:57 AM
dual entries in cron log for cron.daily cpharvey Linux - General 3 02-27-2003 02:30 PM

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

All times are GMT -5. The time now is 02:56 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