On Mon, Dec 09, 2024 at 15:59:38 +0100, to...@tuxteam.de wrote: > On Mon, Dec 09, 2024 at 03:24:06PM +0100, Roger Price wrote: > > I added lines to /etc/crontab such as > > > > # Watch over the NUT heartbeat at 0803 hr every day > > 3 8 * * * nut /usr/local/bin/heartbeat-watcher.sh > /dev/null > > 2>&1
OK. You have the correct format here. Unfortunately, you've redirected all the output and errors to /dev/null, so you won't know if it breaks, or why. You should, however, be able to find a log file (or journal) somewhere on the system indicating that the job was attempted at 08:03. If you want any more details (like why it's failing), get rid of the redirections and let it email the output to you (or whoever "nut" is). > > I added a username, but crontab -e didn't complain. > > I still fear your crontab won't do what you expect it to do. > > Most probably cron will just see what you intended as a user > name as part of the command: > > rprice /mnt/home/rprice/bark/bark.sh 11 > /dev/null 2>&1 > > will run the command "rprice" on the args "/mnt..."; most of > the time this will be a "no such file or so-and-so", sometimes > it might lead to surprising results ;-) This is all correct. You (Roger) should remove the username field from the "crontab -e" variant. Beyond that, if your command isn't working when run from cron, you will need to read the output. So get rid of those redirections, and let it email the output to you. If your system doesn't have local email delivery working, then change the redirections to write the output to a file, instead of /dev/null. Then read what's in the file.