The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Operating Systems > Linux > Red Hat
.
google unix.com



Red Hat Red Hat is the world's leading open source technology solutions provider with offerings including Red Hat Enterprise Linux (RHEL), Fedora, open source applications, security and systems management, virtualization, and Services Oriented Architecture (SOA) solutions.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Crontab Question. NycUnxer UNIX for Dummies Questions & Answers 9 11-14-2007 11:53 AM
CRONTAB Question pauls_579 UNIX for Dummies Questions & Answers 2 01-23-2007 05:46 PM
Crontab question *Jess* SUN Solaris 3 07-26-2006 01:19 AM
crontab question steelrose UNIX for Dummies Questions & Answers 5 10-05-2005 01:07 AM
crontab question Relykk UNIX for Dummies Questions & Answers 7 03-28-2004 09:02 PM

Reply
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 10-14-2009
shipon_97 shipon_97 is offline
Registered User
  
 

Join Date: Mar 2009
Posts: 40
Question about crontab file!

Friends ,

I have the following questions about crontab file :

1) In crontab file I got the folllowing output :

Code:
[root@lpt ~]# cat /etc/crontab
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/
# 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

I know that the file under cron.hourly/daily/weekly are system specific executables file . Then If I want to keep a manual script like (test.sh) into cron.daily and i want it runs at 10:00 am everyday, so I edit the crontab file :

Code:
00 10 * * * root run-parts /etc/cron.daily

But the script(test.sh) is not working .

Now my question , is it not possible to run the manual scirpt (not system specific) using cron.daily or cron.hourly directory ? or it is only used for system specific executables file ? Hope I have to clear my question .

2) What is the function of 'run-parts' command .

3)
In the below crontab line :

Code:
 */5  * * * * /tmp/test.sh

what is meaning of 5 ? it it 5 sec or 5 min


Waiting for ur kind reply ... ...

Last edited by pludi; 10-14-2009 at 04:06 AM.. Reason: code tags, please...
  #2 (permalink)  
Old 10-14-2009
thegeek thegeek is offline
Registered User
  
 

Join Date: Apr 2009
Location: /usr/bin/vim
Posts: 464
1. It is not system specific: If you do everything right, then it should work.

2. man run-parts : man run-parts(8) - run scripts or programs in a directory by debian Translated by humans

3. That is 5 minutes, man 5 crontab


Code:
 
field          allowed values
-----          --------------
minute         0-59
hour           0-23
day of month   1-31
month          1-12 (or names, see below)
day of week    0-7 (0 or 7 is Sun, or use names)

  #3 (permalink)  
Old 10-14-2009
mark54g mark54g is offline
Registered User
  
 

Join Date: May 2008
Posts: 369
copy the script to the directory, don't edit the cron.daily configs.

Also, the script may be failing if the environment variables that you are defining are not set in the script. If you run it manually and it works, but does not in cron, that is usually the case.

Also, if you want the script to run at a different interval than the cron.X then just set up a specific cron job for it with crontab -e.

the cron.X files are for anacron to manage your jobs.
Reply

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:42 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