SlackwareThis Forum is for the discussion of Slackware 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.
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.
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.
Thanks for the reply. I tried the /usr/bin/echo "Hello From Crontab" | /usr/bin/wall and I still get no response from cron. I have also tried the getmail command to retrieve my e mail but it looks like cron is refusing to respond for some reason. Getmail works if I try it manually.
I just tested it as my normal user and this seems to work:
Code:
$ crontab -l
* * * * * /path/to/script.sh
script.sh consists of the following:
Code:
$ cat /path/to/script.sh
#!/bin/sh
/usr/bin/echo "Hello From Crontab" | /usr/bin/wall
I could get cron to perform the wall command but the message wasn't carrying through with my previous suggestions (it was just a blank message), and using quotes didn't seem to help the issue. This solution works, however.
An easy way to test whether or not cron is working is to delete your current crontab (`crontab -d`) and add the following line:
I just tested it as my normal user and this seems to work:
Code:
$ crontab -l
* * * * * /path/to/script.sh
script.sh consists of the following:
Code:
$ cat /path/to/script.sh
#!/bin/sh
/usr/bin/echo "Hello From Crontab" | /usr/bin/wall
I could get cron to perform the wall command but the message wasn't carrying through with my previous suggestions (it was just a blank message), and using quotes didn't seem to help the issue. This solution works, however.
An easy way to test whether or not cron is working is to delete your current crontab (`crontab -d`) and add the following line:
That way you could see if there are any errors. You may also wish to direct standard out to a file as well. Something like the following would throw every message into a file:
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.