I am a happy user of Opensuse 13.1 KDE, but a cron job for a backup script I use does not run for some reason - it worked perfectly in opensuse kde 12.3.
You may have the impression that the job does not run, but you tell us nothing that poves it.
At least you could put a statment in the beginning of that sript (so you are almost 100% that it is executed when the script is called) like
touch /tmp/lasttimemyscriptrunned
or an echo to some file with dat/time included (many posibilities). But just telling us that it does not work gives us nor you any information.
And of course a step in the whole debugginng process is showing (proving) that that file exists and what its properties are:
You are absolutely right it ran today. Why did it run on Sundays in opensuse 12.3 but now it’s on a Monday? It makes sense to me that day 1 is a Monday, was there a change in the way cron works?
On 12/02/2013 10:16 AM, londondaveuk wrote:
>
> Thanks ab,
>
> You are absolutely right it ran today. Why did it run on Sundays in
> opensuse 12.3 but now it’s on a Monday? It makes sense to me that day 1
> is a Monday, was there a change in the way cron works?
Wildly guessing… your date was off? Maybe your memory of the old way
is off?
I guess it could have been an issue in cron, but I have never seen that
before personally. With that said, I seldom use the day-of-week field in
cron so don’t give me too much credit there.
–
Good luck.
If you find this post helpful and are logged into the web interface,
show your appreciation and click on the star below…
On 2013-12-02 18:16, londondaveuk wrote:
>
> Thanks ab,
>
> You are absolutely right it ran today. Why did it run on Sundays in
> opensuse 12.3 but now it’s on a Monday? It makes sense to me that day 1
> is a Monday, was there a change in the way cron works?
crontab(5)
The time and date fields are:
field allowed values
----- --------------
minute 0-59
hour 0-23
day of month 1-31
month 1-12 (or names, see below)
day of week 0-7 (0 or 7 is Sunday, or use names)
Thus “10 11 * * 1” is certainly a Monday.
The version of cron we use is “Cronie”, I don’t know if other versions
have different definitions for weekdays. You can use names instead, the
manual says.
–
Cheers / Saludos,
Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)
Similarly, my job does not run in cron, however it runs fine when I call the script.
It is: 0 1 * * * /home/jim/backup.sh > “/tmp/backup$(date + %Y-%M-%D_%H:%M).log”
I have set the bios to wake 5 minutes before 1am. Even though under KDE Control Module Energy Saving, I have un-checked suspend system, should my cron job be scheduled under root?
Similarly, my job does not run in cron, however it runs fine when I call the script.
It is: 0 1 * * * /home/jim/backup.sh > “/tmp/backup$(date + %Y-%M-%D_%H:%M).log”
I have set the bios to wake 5 minutes before 1am. Even though under KDE Control Module Energy Saving, I have un-checked suspend system, should my cron job be scheduled under root?
Hi jgilbe and welcome to the openSUSE community forum,
Because your problem isn’t exactly the same than the original poster, and because you should have started another thread for the problem your are encountering. Anyway, your problem can easily be fixed. The % character has a special meaning in crontab:
Just escape the % character using \ in crontab and all should be fine.
In your call of the date program, you seem to have a space character between + and the description of the date format (%Y-%M-%D_%H:%M). The correct syntax would be: