Need help running cron in Slackware 12.1
Hello:
I am going through a Crontab tutorial and have reached a roadblock. I have tried the following test as a user and as root using crontab -e: * * * * * /usr/bin/wall "Hello From Crontab" I get no response or messages as I instructed. I did a ps -aux | grep crond and it shows crond running: root 2838 0.0 0.0 1912 632 ? S May30 0:00 /usr/sbin/crond -l10 I can't figure out why cron will not run as both a user and root for me. Any help will be appreciated. Best regards |
That's really nifty, I didn't know about the "wall" command. However, your syntax is incorrect. I tested `/usr/bin/wall "Hello From Crontab"` and received an error. `wall` is expecting a file to display instead of a message. There are two options. You could create a file with those contents and use `/usr/bin/wall < /path/to/file.txt`, or you could use `/usr/bin/echo "Hello From Crontab" | /usr/bin/wall`. Either one will work.
|
Quote:
|
I just tested it as my normal user and this seems to work:
Code:
$ crontab -l Code:
$ cat /path/to/script.sh An easy way to test whether or not cron is working is to delete your current crontab (`crontab -d`) and add the following line: Code:
$ crontab -l |
Quote:
|
I meant I tried the * * * * * DISPLAY=:0.0 /usr/bin/xmessage "Hello"
and it didn't work. I did it as root. |
You may wish to direct your error output to a file to see what's happening. Something like the following would do nicely:
Code:
$ crontab -l Code:
$ crontab -l |
Well I tried it and this is what the error.txt indicates:
No protocol specified Error: Can't open display: :0.0 Best regards |
Well, that at least means that crond is working. I won't try to determine why the xmessage thing isn't working because it isn't relevant to the wall command (though it probably has something to do with running the crontab entry as root, or possibly something's awry if you use runlevel 4). You could try doing the same with the wall script I posted above to see why it isn't working.
|
I got it to work doing it as a script...* * * * * /path/to/script.sh
I'm happy knowing that Cron is working. I really appreciate the help you have given me T3slider. Best regards |
All times are GMT -5. The time now is 07:19 PM. |