![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Script to move certain number of files every 10 minutes. | amitsayshii | UNIX for Dummies Questions & Answers | 1 | 02-26-2007 04:55 AM |
| script to kill rsh processes running for more than 10 minutes | amitsayshii | Shell Programming and Scripting | 1 | 06-27-2006 10:12 AM |
| script to kill rsh processes running for more than 10 minutes | amitsayshii | UNIX for Advanced & Expert Users | 1 | 06-27-2006 10:07 AM |
| Convert minutes to hours, minutes, seconds | Vozx | Shell Programming and Scripting | 1 | 12-09-2005 01:24 AM |
| C Shell Script to convert a number into minutes | Ringo | Shell Programming and Scripting | 1 | 08-07-2003 01:24 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
cron is your friend.
Cron from the name Chronos (the god of time) The cron daemon is a long-running process that executes commands at specific dates and times. You can use this to schedule activities, either as one-time events or as recurring tasks For commands that need to be executed repeatedly (e.g., hourly, daily, or weekly), you can use the crontab command. The crontab command creates a crontab file containing commands and instructions for the cron daemon to execute. You can use the crontab command with the following options: crontab filename installs a crontab from the file crontab -e Edit your crontab file, or create one if it doesn't already exist. crontab -l Display your crontab file. A typical crontab will have system maintenance type tasks but any task can be put into cron. Each entry in a crontab file consists of six fields, specifying in the following order: minute(s) hour(s) day(s) month(s) weekday(s) command(s) 10 3 * * 0,4 /etc/cron.d/logchecker 10 3 * * 0 /usr/lib/newsyslog 15 3 * * 0 /usr/lib/fs/nfs/nfsfind |
|
||||
|
To choice if you want to execute this script for everybody or for a specific user, that don't need to be the logged user like crontab -e, you can edit the file /etc/crontab. This file is similar similar, but there you have more one parameter, that is the user.
|
|
||||
|
I just tried a simple thing - to display time on the terminal every 5 minutes .. this is my crontab entry for it - but it doesnt seem to work ... y is that?
pwd /usr/lib contab -e no crontab for root - using an empty one crontab: installing new crontab crontab -l 0,5,10,15,20 * * * * (echo -n ' '; date; echo " ") > /dev/console |
|
||||
|
If I use,
*/5 * * * * /home/shahnaz/abc.sh >> /home/shahnaz/abc.log I get an error saying like crontab: error on previous line; unexpected character found in line. Can you say why it was thrown such error? |
| Sponsored Links | ||
|
|