cron not working from crontab nor form /etc/cron/cron.d. What did SuSE change?
SUSE / openSUSEThis Forum is for the discussion of Suse Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
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
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,637
Original Poster
Rep:
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
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).
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.
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,637
Original Poster
Rep:
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.