Help - Search - Members - Calendar
Full Version: Cron giving odd errors
Linuxhelp > Support > Technical Support
I run cron to logout users at a certain time and then run my system backup for the database and then a complete back up

Someone changed the email address and ever since them it's been sending me the email of status with errors the following are the emails with subject in "( )"

/bin/bash: line 1: root: command not found (root run-parts /etc/cron.daily)

/bin/bash: line 1: root: command not found (root /root/backup/daily.backup)

/bin/bash: /root/backup/daily.backup: /bin/bash: bad interpreter: No such file or directory (/root/backup/backup.daily)

/bin/bash: line 1: root: command not found (root /root/logout/logout_everyone_latest)

And here is Cron
# run-parts
#01 * * * * root run-parts /etc/cron.hourly
02 4 * * * root run-parts /etc/cron.daily
22 4 * * 0 root run-parts /etc/cron.weekly
42 4 1 * * root run-parts /etc/cron.monthly
#Daily backup. Tuesday through Saturday 1:00 AM.
0 1 * * 2-6 root /root/backup/daily.backup
#Weekly backup. Runs on Sunday 1:00 AM.
0 1 * * 7 root /root/backup/weekly.backup
#Logout Students every weeknight and Saturday at 9:30 PM.
30 21 * * 1-6 root /root/logout/logout_everyone_latest
#Weekly backup. Runs on Sunday 1:00 AM.
0 1 * * 7 root /root/backup/
#Synchronize system time with time server. Runs on Monday at 1:00 AM.
0 1 * * 1 root rdate -s -u

anyone with more knowledge than me on this topic would be doing me a great service by helping out with a suggestion.
oh i checked and yes all files backup.daily and so on are in their proper directory

Thanks again
*** Chop - DS2K3 ***

Generally, you don't need to bump things a day after you post - We (sadly) don't have the volume of traffic to push your post off of the front page in that time scale - Maybe bump after a week. Regardless of when, you don't need to re-quote whole original post :-)

Anyway, in answer to your question:

I think you need to remove the "root" portion of each line - The user which a command runs under is determined by whose "crontab" (type "man 5 crontab" for more info) the command is listed in. In this case, the "root" is being interpreted as part of the command that you want to execute (obviously it isn't actually a command, hence the error) rather than information about who to do it as.

This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2018 Invision Power Services, Inc.