The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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 11:29 AM
cc command not found mishra_sk_in UNIX for Dummies Questions & Answers 4 08-14-2007 05:00 AM
how can i check in csh if command found or not found ? umen Shell Programming and Scripting 2 03-03-2007 07:38 PM
How do I prevent cron from returning errors on a file not found? goodmis Shell Programming and Scripting 6 02-06-2007 10:14 AM
sh: Hello: command not found coolboarderguy Shell Programming and Scripting 2 06-24-2006 04:27 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 07-13-2002
sstevens sstevens is offline
Registered User
  
 

Join Date: Jul 2002
Location: NM, USA
Posts: 21
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.
  #2 (permalink)  
Old 07-14-2002
hell666 hell666 is offline
Registered User
  
 

Join Date: Jul 2002
Location: void
Posts: 53
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
sstevens sstevens is offline
Registered User
  
 

Join Date: Jul 2002
Location: NM, USA
Posts: 21
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 Forum Advisor  
Hog Hunter
  
 

Join Date: Apr 2002
Location: On my motorcycle
Posts: 3,039
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
art_malabanan art_malabanan is offline
Registered User
  
 

Join Date: Feb 2002
Posts: 32
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
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 01:57 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0