- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Crontab doesn't execute a new script...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2002 04:36 AM
07-17-2002 04:36 AM
Crontab doesn't execute a new script...
I've been a problem with contrab.I've a crontab entry that had 4 scripts runnning fine.I needed add a new script but it's doesn't work anyway.The changes was made from crontab -e.
I've tested the script manualy and it works fine.
Some help would be very appreciated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2002 04:42 AM
07-17-2002 04:42 AM
Re: Crontab doesn't execute a new script...
what is your crontab entry?
do you know if cron start the script and then it fail or the script is never run?
If the script is run it's possible that you could execute your script manually and when the script is executed in cron it will fail. The reason is that cron will not read your .profile file and all the environment variables (like PATH) won't be define. so you should make sure that you always use full path for your commands inside your script.
Luc
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2002 04:43 AM
07-17-2002 04:43 AM
Re: Crontab doesn't execute a new script...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2002 04:45 AM
07-17-2002 04:45 AM
Re: Crontab doesn't execute a new script...
i think you are perhaps missing the path to your script so the shell can't find it. Try the following:
0 * * * * /path/to/your/script
or you could edit your /etc/PATH file:
vi /etc/PATH --> A (append at end of line)
:/path/to/your/script/directory
ESC
:wq!
after this you have to relogin to get it to work.
Allways stay on the bright side of life!
Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2002 04:47 AM
07-17-2002 04:47 AM
Re: Crontab doesn't execute a new script...
you can look at /var/adm/cron/log to see if the script is executed. But i agree with Luc that it must be a problem with the env variables, like PATH, SHELL...You migth set them at the begining of the script.
Best regards
Juan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2002 04:48 AM
07-17-2002 04:48 AM
Re: Crontab doesn't execute a new script...
ensure at the end of your new entry you have 2>&1 to redirect stderr and stdout
Also, you generally shouldn't need to stop and start cron because of the way you have added your entry via crontab -e. Give it a go and reset cron
/sbin/init.d/cron stop
/sbin/init.d/cron start
Check the permissions on your new script with regard to the cron user if not root
Please post the crontab file
HTH
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2002 04:53 AM
07-17-2002 04:53 AM
Re: Crontab doesn't execute a new script...
is you cron daemon running? If yes, there shold be messages about the execution of the scripts in /var/adm/cron/log
Any clues there?
regards,
John K.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2002 04:54 AM
07-17-2002 04:54 AM
Re: Crontab doesn't execute a new script...
the standard output and standard error for cron is the mail account of the user which run the cron job. Perhaps your script *has* been executed but you do not see the results/output?
Look into your mail account to verify this.
you have to redirect the output of your script if you want to see it:
0 * * * * /path/to/script 1>/dev/pts/0 2>&1
--> would redirect your scripts output to a terminal, also error message is redirected there.
Allways stay on the bright side of life!
Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2002 05:57 AM
07-17-2002 05:57 AM
Re: Crontab doesn't execute a new script...
Regards !
Halan Leno
Brazil - Sao Paulo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2002 06:06 AM
07-17-2002 06:06 AM
Re: Crontab doesn't execute a new script...
the entry in your cronfile seems to be ok. Did you have a look to the mail account of the user sybase? Can you please post your script here to find out if the error is in script code? Perhaps the script needs some parameters which are used inside it?
Allways stay on the bright side of life!
Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2002 06:17 AM
07-17-2002 06:17 AM
Re: Crontab doesn't execute a new script...
You may need to change the crontab entry to this...
0 2 * * 2-5 /data2/batch/updt_iq.sh >/tmp/updt_iq.log 2>&1
Then you can look at the log file for clues about what is happening.
You may want to add "set -x" to the script to get more information.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2002 06:30 AM
07-17-2002 06:30 AM
Re: Crontab doesn't execute a new script...
Have you checked the cron log file at /var/adm/cron/log . Check and see if the script is executed and also make sure the execute permissions are set for the script.
Hope this helps.
Regds
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2002 06:54 AM
07-17-2002 06:54 AM
Re: Crontab doesn't execute a new script...
give full path of ur script in the crontab.
if it is link file then use
sh before the file path
regds
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2002 07:07 AM
07-17-2002 07:07 AM
Re: Crontab doesn't execute a new script...
Manoj Srivastava
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2002 08:50 AM
07-17-2002 08:50 AM
Re: Crontab doesn't execute a new script...
If this is allright, go for the option of writing to a log-file mentioned by Rich Wright. Hopefully this gives you more information.
Good luck, BB
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2002 12:54 PM
07-17-2002 12:54 PM
Re: Crontab doesn't execute a new script...
1. What's with this??!?!?
0 5 18 4 4 /data2/check/check3
0 2 8 5 3 /data2/batch/create_dcfusao.sh
The format is.....
minute hr dayofmonth monthofyear dayofweek file
So it you have "0 5 18 4 4 check3" you are saying to run this ONLY on 18April at 5am ONLY if it is a THURSDAY.
0 0minutes
5 5am
18th of month
4 April
4 Thursday (0=sunday -> 6=saturday)
2. When running the cronjobs, you need to source in your environment. I.E. things like $SYBASE, and $SYBASE_ASE.
I got burned once this way.
3. I don't use "crontab -e". Instead I....
a. crontab -l > myfile
b. cp myfile crontab.previous
c. vi myfile
d. cp myfile crontab.new
e. crontab crontab.new
Why? Because you risk losing your crontab file.
I got burned once this way...too.
Hope this helps. STeve