Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 03-01-2008, 11:53 AM   #1
Registered: Mar 2007
Location: Utah
Distribution: Gentoo Linux (3.0.6-gentoo)
Posts: 222

Rep: Reputation: 32
Cron Schedule Issue

After editing my crontab to include my backup script a new error has started appearing that i have tried to correct but have so far been unsuccessful. I have for the past two days been receiving the following email every hour. Below is the msg.

/bin/sh: root: command not found
Here is my crontab. I have check to make sure that there are no extras spaces then is required.

# /etc/crontab: system-wide crontab
# Unlike any other crontab you don't have to run the `crontab'
# command to install the new version when you edit this file
# and files in /etc/cron.d. These files also have username fields,
# that none of the other crontabs do.


# m h dom mon dow user  command
17 *    * * *   root    cd / && run-parts --report /etc/cron.hourly
25 6    * * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
47 6    * * 7   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
52 6    1 * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )

# Backup of County data and system configuration
# m h dom mon dow user  command
00 21   * * *   root    /etc/cron.daily/backup.cron
I had to add the line for my backup script directly because cron wouldn't execute it even thought it was included in /etc/cron.daily directory. Any advice would be well appreciated.

Edit: Forgot to add that this error is only for the /etc/cron.hourly line.

Last edited by richinsc; 03-01-2008 at 11:54 AM. Reason: Error
Old 03-01-2008, 04:36 PM   #2
LQ Guru
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 12,658

Rep: Reputation: 1817Reputation: 1817Reputation: 1817Reputation: 1817Reputation: 1817Reputation: 1817Reputation: 1817Reputation: 1817Reputation: 1817Reputation: 1817Reputation: 1817
IIRC you cannot have a dot "." in the command/script you want cron to run. So rename your script to just plain backup and see if it works.

Old 03-01-2008, 04:57 PM   #3
LQ Guru
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
I cetrtainly call my scripts .sh, and I run these from cron with a dot in them OK.

Why not just put your backup in root's crontab with crontab -e, but omit the user, ie:

00 21   * * *   /etc/cron.daily/backup.cron
instead of

00 21   * * *   root    /etc/cron.daily/backup.cron
Old 03-01-2008, 05:32 PM   #4
Senior Member
Registered: Aug 2007
Location: Massachusetts, USA
Distribution: Solaris 9 & 10, Mac OS X, Ubuntu Server
Posts: 1,197

Rep: Reputation: 105Reputation: 105
If you are getting this error every hour, what makes you think it is your daily cron?

where is "run-parts"? If sh can't find something, and it is happening every hour, it would seem you might want to look at that.


command, crontab, error, found

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Schedule a command for twice daily with cron? pdeman2 Linux - Software 7 04-23-2013 05:47 PM
what is cron schedule coldbeerz Linux - Newbie 5 12-05-2007 03:24 PM
LXer: Schedule Tasks Using Gnome-schedule (cron & at GUI) LXer Syndicated Linux News 0 07-28-2007 12:31 AM
How do I schedule a cron job? BillyGalbreath Debian 1 05-18-2006 09:52 PM
Trying to schedule ftp login using cron compuser Linux - General 2 06-10-2005 04:22 AM > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 11:45 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration