LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

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

Rep: Reputation: 31
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.

Code:
/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.

Code:
# /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.

SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=myemail@domain.com

# 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
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,775

Rep: Reputation: 1296Reputation: 1296Reputation: 1296Reputation: 1296Reputation: 1296Reputation: 1296Reputation: 1296Reputation: 1296Reputation: 1296
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.

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

Rep: Reputation: 120Reputation: 120
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:


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

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

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.
 
  


Reply

Tags
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
Trackbacks are Off
Pingbacks are On
Refbacks are 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


All times are GMT -5. The time now is 02:45 AM.

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