[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Cron 101: SOLVED "/bin/sh: root: command not found"



On 11/05/2014 13:42, Andrei POPESCU wrote:
On Du, 11 mai 14, 12:07:47, Ron Leach wrote:

/var/spool/cron/crontabs/root indeed contains exactly the error you mention:

# DO NOT EDIT THIS FILE - edit the master and reinstall.
[ ... ]
Filip, the comment suggests that I shouldn't edit this file here.

Actually you have no way of knowing this. That part could have just been
copy-pasted by someone mistaking root's crontab with the system crontab
(/etc/crontab). The presence of a 'user' field seems to support this.

My suggestion still stands: keep the content of root's crontab somewhere
(just in case), but remove it.


Andrei, I have not done what you suggest; instead I edited root's crontab and uncommented the error line, using the

# crontab -u root -e

command that Filip suggested. I did that in case the other sections of root's crontab were doing useful things. This change has stopped the hourly emails complaining about the command, so the immediate issue is solved.

Earlier, I had tried to make a copy of the file as you suggested earlier (in case), but abandoned that because I've also encountered a filespace exhaustion, which I've (separately) just posted about.

I've learnt two things from this thread:

'crontab' is a command, as well as a filename in /etc . I hadn't understood that.

Additionally, there are 'user' crontabs in /var/spool/cron/crontabs .

As someone said recently on another thread, there are a lot of knowledgeable people on this list, who give generously - and patiently - of their time; I'd like to thank the three of you for the help this morning.

regards, Ron


Reply to: