![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| 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 !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Symark Software Named to Software Magazine’s Software 500 for ... - Business Wire (pr | iBot | UNIX and Linux RSS News | 0 | 10-29-2007 06:40 AM |
| HP To IBM: Welcome To The Party - IT Management | iBot | UNIX and Linux RSS News | 0 | 08-18-2007 06:31 AM |
| how to find the software packages and root directories | krishna176 | SUN Solaris | 1 | 03-29-2007 07:02 AM |
| Cron Sends mail to root on completion of job. | skotapal | UNIX for Dummies Questions & Answers | 1 | 04-25-2003 01:27 PM |
| root cron | kupal | UNIX for Dummies Questions & Answers | 2 | 07-08-2002 11:10 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi Guys,
I'm new in Unix Environment. Any Unix Guru around...I need help. My question is, is it possible that the root cron could be override with 3rd party software?How can it happen. Another thing, how the cron job works?, I mean how the Unix process the cron job , I don't have an idea about cron, any insight about the cron, what would be the implication if I modified the contents of it. Any comments would be appreciated.. Thanks in advance. |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
Cron is controlled by a set of files called "crontabs". There is the master file in /etc/crontab (Red Hat Linux), along with crontab files for the users in /var/spool/cron/. In the latter directory, the files are given the same name as a user's login ID.
Crontab location: /var/spool/cron /etc/crontab In RH Linux, it is a little easier for the sysadmin to set up cron jobs than in other distributions. The /etc/crontab file automatically executes items in several subdirectories at regular periods. /etc/cron.hourly /etc/cron.daily /etc/cron.weekly /etc/cron.monthly All the sysadmin needs to do is drop a shell script or a link to an executable in one of the directories and it will automatically be run at the appropriate time. Setting up a user-level crontab is somewhat different. The files in /var/spool/cron are not edited directly. Instead, a program called "crontab" is used to manipulate them. Depending on system security, all users, only some, or just the root user will be able to use crontab (see man crontab /etc/cron.allow and /etc/cron.deny for more information). SYNOPSIS crontab [ -u user ] file crontab [ -u user ] { -l | -r | -e } file store the specified file as the current crontab -u user the crontab file being manipulated is for -l display the current crontab -r remove current crontab -e edit the current crontab (editor depends on system variables and will probably be vi unless your sysadmin has changed it). If you are not familiar with the systemwide default editor, it is probably best to create/edit the file with one you are familiar with and use the file option with the first command. Crontab configuration: Blank lines, leading spaces, and tabs are ignored. Lines that start with a # are comments and are ignored. Comments are not allowed to be on the same line as cron commands; they will be assumed to be part of the command. Comments are not allowed on the same line as environment settings for similar reasons. Syntax Environment settings take the format of name = value (The spaces around the = are optional.) Each cron command has 5 time and date fields, followed by a user name, and if this is the system crontab file, it will be followed by a command. Commands are executed when the time specified by the time/date fields matches the current time. field allowed values ----- -------------- minute 0-59 hour 0-23 day of month 0-31 month 0-12 (or names, see below) day of week 0-7 (0 or 7 is Sun, or use names) A field may be an asterisk (*), which always stands for ``first to last''. So used in the hour field, it means 'every hour from 00:00 to 24:00" Example Crontab: # r----minute # | r-----hour # | | r------day of the month # | | | r------month # | | | | r------day of the week # | | | | | |------ command to run -------------> # | | | | | | 5 0 * * * $HOME/bin/daily.job >> $HOME/tmp/out 2>&1 # run five minutes after midnight, every day 15 14 1 * * $HOME/bin/monthly # run at 2:15pm on the first of every month -- output mailed to paul 0 22 * * 1-5 mail -s "It's 10pm" joe%Joe,%%Where are your kids?% # print out the message at 4:05 every sunday. 5 4 * * sun echo "run at 5 after 4 every sunday" If this file were saved as "paul.ct" then crontab -u paul paul.ct would be used to store the crontab for the user paul. For more information: man cron |
|
#3
|
|||
|
|||
|
Killerserv, thanks for your response, I appreciate it. 'wish I could share something with you too, but I know I need to learn more..I think microsoft needs to have this kind of message forum too.....hum hum,,,anyway 'hope to hear from you again...
|
|||
| Google The UNIX and Linux Forums |