![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | 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 !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| i want a script to execute if the time is 12:00 automatically | lakshmananindia | UNIX for Advanced & Expert Users | 2 | 09-04-2007 05:22 PM |
| Can we launch a shell script automatically upon ssh login? | rockysfr | UNIX for Advanced & Expert Users | 1 | 07-02-2007 11:48 PM |
| how to run a Script automatically | hamsa | UNIX for Dummies Questions & Answers | 4 | 10-18-2006 05:09 PM |
| Script to automatically change password. | rahulrathod | Shell Programming and Scripting | 1 | 10-04-2004 09:33 AM |
| Script to find PID and kill automatically | ST2000 | Shell Programming and Scripting | 4 | 08-01-2002 11:38 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Hi All,
How to run a script automatically using cronjob everyday from Monday to Friday 9A.M to 5P.M at an interval of ONE HOUR.I want the complete syntax means how to put in the cron job and there after. URGENTLY NEED HELP THANKS IN ADVANCE CHEERS Arunava |
|
||||
|
To enter the above data that PxT shared, you can type 'crontab -e' and edit the file. If it opens it in an unknown editor, set your EDITOR variable to vi or another editor. You can also put the entry in an arbitrary flat file and execute
crontab flat_file |
|
||||
|
Thanks for the reply .
So if i want to execute my file eith the name myfile.sh everyweekday at an interval of one hour from 9 a.m. to 5 p.m. will the command be 0 9-17 * * 1-5 myfile.sh [ can we give a path here like /mydir/myfile.sh] Also how do u put the entire thing using crontab command. I will like to know the detail syntax. Bye Thanks in advance Cheers Arunava |
|
||||
|
The easiest way is to create a text file named /tmp/myfile.sh.cron (name and location are relative and do not matter) with your cron statement in it: Code:
0 9-17 * * 1-5 /home/user/bin/myfile.sh You should always put the full path to the file in the crontab and a shell script as your PATH variable may not be what you think it is. This entry will run the script as you described. Then logged in as the user you wish to run the program as, type: Code:
crontab /tmp/myfile.sh.cron You can the delete the myfile.sh.cron file. To verify that it read it in, type: Code:
crontab -l |
|
||||
|
I am having problem when i am trying to execute my shell script .In the beginning of my script i am reading some parameter values from a parameter file. After that in this script i am calling an external sql script.
It gives an error message grep: can't open parameter.txt grep: can't open parameter.txt Calling an external SQL script /final/myscript.sh: mysql .sh: not found When i independently run my script there is no problem atall. URGENTLY REQUIRE HELP THANKS IN ADVANCE Arunava |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|