The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Command not found manna UNIX for Dummies Questions & Answers 20 01-10-2008 07:29 AM
cc command not found mishra_sk_in UNIX for Dummies Questions & Answers 4 08-14-2007 02:00 AM
how can i check in csh if command found or not found ? umen Shell Programming and Scripting 2 03-03-2007 03:38 PM
How do I prevent cron from returning errors on a file not found? goodmis Shell Programming and Scripting 6 02-06-2007 06:14 AM
sh: Hello: command not found coolboarderguy Shell Programming and Scripting 2 06-24-2006 01:27 AM

Closed Thread
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-13-2002
Registered User
 

Join Date: Jul 2002
Location: NM, USA
Posts: 20
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
cron command not found

I'm trying to execute a command in my crontab, but every hour I'm sent mail that says

/bin/bash: root: command not found

Does anyone know why I'm getting that message? It was in the crontab before I started screwing around with it and it was working fine. Now that I messed with it, ran a couple of tests, then restored the backup crontab, it doesn't work.
Forum Sponsor
  #2 (permalink)  
Old 07-14-2002
Registered User
 

Join Date: Jul 2002
Location: void
Posts: 53
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
Have you included the absolute path of your program to be run in your crontab file? Like:
/user/myprog instead of just myprog
  #3 (permalink)  
Old 07-14-2002
Registered User
 

Join Date: Jul 2002
Location: NM, USA
Posts: 20
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
Absolute Path

If I understand which part of the line you're talking about, yes. I didn't put an absolute path to the command 'root', but I didn't think I needed to. I did use the absolute path for the program I am trying to run, though. Here is the line of code.

01 * * * * root run-parts /etc/cron.hourly

This is going to seem like a stupid question, but the only thing I've done with Unix is this crontab stuff, so I know next to nothing. What is the command used to run a program from the command line? I'd like to test out a couple programs in the cron.hourly directory, but I don't know how. Thank you for the reply!
  #4 (permalink)  
Old 07-15-2002
RTM's Avatar
RTM RTM is offline
Hog Hunter
 
Join Date: Apr 2002
Location: On my motorcycle
Posts: 3,039
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
Quote:
01 * * * * root run-parts /etc/cron.hourly
The format does not seem correct.

A crontab file consists of lines of six fields each. The
fields are separated by spaces or tabs. The first five are
integer patterns that specify the following:

01 * * * *
minute (0-59),
hour (0-23),
day of the month (1-31),
month of the year (1-12),
day of the week (0-6 with 0=Sunday).

(This part seems right...if you are trying to run once an hour at 1 minute past the hour)

The sixth field of a line in a crontab file is a string that
is executed by the shell at the specified times. A percent
character in this field (unless escaped by \) is translated
to a NEWLINE character.

This is where you are having a problem - you are putting 'root' as a command or script or executable to run - it isn't as far as the system can tell, hence the error.

What is the program or script or command you are trying to run?

What are you attempting to use /etc/cron.hourly for (the output?)?

If you want to see how it works for a command try this:

01 * * * * date > /tmp/uptodate.tmp

This will put the output of the date command into the tmp file uptodate.tmp and overwrite it every hour.

Read the man page on crontab - you should be able to figure it out from the examples given.
  #5 (permalink)  
Old 07-17-2002
Registered User
 

Join Date: Feb 2002
Posts: 32
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
hello there ,

first of all u need to make sure that your script is exectable CHMOD then do a crontab FILENAME to execute the crons
to see if what cron is running u need to do a crontab -l it will show th script thats running .

inside your script should be like this:

hr min * * * /filename

(ex: 16 00 * * * /filename) this will run srcript everyday at 1600hrs

* * * is your control for week day month if it is marked * * * that means it will run it everyday on the time u put in .

also make sure that ur script/cron ur running is on /usr/spool/cron/crontabs directory

art
Google UNIX.COM
Closed Thread

Thread Tools
Display Modes


The 50 most popular UNIX and Linux searches.
Google Search Cloud for The UNIX and Linux Forums
421 service not available, remote server has closed connection ^m automate ftp autosys awk trim bash eval bash for loop boot: cannot open kernel/sparcv9/unix command copy/move folder in unix couldn't set locale correctly curses.h cut command in unix find grep find mtime find null character in a unix file grep multiple lines grep or grep recursive hp-ux ifconfig inaddr_any inappropriate ioctl for device lynx javascript mailx attachment mget mtime perl array length ping port remove first character from string in k shell replace space by comma , perl script rsync ftp scp recursive segmentation fault(coredump) sftp script snoop unix solaris change ip address stale nfs file handle syn_sent tar exclude tar extract to folder test: argument expected unix unix .profile unix forum unix forums unix internals unix interview questions unix mtime unix simulator unix.com while loop within while loop shell script


All times are GMT -7. The time now is 01:53 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101