Kernel_Killer
July 11th, 2004, 03:48
This is quite odd. Usually I could add a cron job manually, run `crontab /etc/crontab` and it would work no problem. Now I can't get one to work on this new 4.10 system. I just recently updated to 4.10 from 4.9, and hoping that's not the problem.

I added the cron job like this:


#su
password:
# crontab -e


added:


* 2 * * * root /home/VileSYN/xmms.sh


Then :wq of course.

Cron doesn't execute it, or even send an E-mail. I've been trying this since 2:00am. And even when I tried specific times like:


5 2 * * *
10,15 2 * * *


It still wouldn't work. The script executes just fine as a user. Here are the specs of the file:


/home/VileSYN# ls -l xmms*
-rwxr-xr-x 1 root wheel 98 Jul 11 01:58 xmms.sh


I even had it owned by VileSYN:wheel and still no difference. Another thing I tried was:


* 2 * * * root /bin/sh /home/VileSYN/xmms.sh


and


* 2 * * * root -exec /home/VileSYN/xmms.sh


I think that's all I tried. Here's the script:


#!/bin/sh

exec xmms "/home/VileSYN/dcc/409-forgotten_tears_(boys_dont_cry_by_haujobb)-fwyh.mp3"


This script works with PWD as /home/VileSYN and as any other directory executed with /home/VileSYN/xmms.sh .

Anyone have any ideas? TIA

bmw
July 11th, 2004, 13:53
* 2 * * * root /home/VileSYN/xmms.sh

The problem lies right there, KK: don't specify "root" in this type of crontab. The syntax you are using here is appropriate for /etc/crontab, but not the crontabs maintained by the crontab(1) command.

There are two crontab "systems" in use: static entries in /etc/crontab, and entries handled by running crontab(1). /etc/crontab entries have 7 fields and the 6th field specs the user to run as.

But the crontab(1) entries have 6 fields. You don't spec the user because there's a seperate crontab table for each user on the system.

So: change it to this:
* 2 * * * /home/VileSYN/xmms.sh

and you're good to go.

Cheers!