- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Crontab probelm
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
Forums
Discussions
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
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
02-17-2003 02:34 AM
02-17-2003 02:34 AM
Crontab probelm
I am facing some problem in executing crontab.
When I put a shell script i have written in crontab or even try executing it using a"at", it is not executing. But if I try executing it directly, it works.
Does somebody have a solution ???
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2003 02:38 AM
02-17-2003 02:38 AM
Re: Crontab probelm
You can execute crontab if your name appears in the file
/var/adm/cron/cron.allow. If that file does not exist, you can use
crontab if your name does not appear in the file
/var/adm/cron/cron.deny. If only cron.deny exists and is empty, all
Hewlett-Packard Company - 2 - HP-UX Release 10.20: July 1996
crontab(1) crontab(1)
users can use crontab. If neither file exists, only the root user can
use crontab.
Steve Steel
To meet your daily target. Aim Fir call what you hit the target
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2003 02:43 AM
02-17-2003 02:43 AM
Re: Crontab probelm
and i guess you are giving the complete path of the file you are executing using cron.
Rajeev
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2003 02:47 AM
02-17-2003 02:47 AM
Re: Crontab probelm
if you execute a shell-script with cron/at the /etc/profile and $HOME/.profile are not sourced, so cronjobs have an other environment.
To be sure to have the correct environment you have to do something like that:
0 0 * * * (. /etc/profile; . ./.profile;
If you are using c-shell you have to source /etc/csh.login, $HOME/.cshrc and maybe $HOME/.login
Chris
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2003 02:48 AM
02-17-2003 02:48 AM
Re: Crontab probelm
Restarting the cron daemon does solve the problem
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2003 02:53 AM
02-17-2003 02:53 AM
Re: Crontab probelm
These are usually caused by environment issues. Check out:
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x04945220af9bd5118ff10090279cd0f9,00.html
rgds, Robin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2003 01:29 AM
02-18-2003 01:29 AM
Re: Crontab probelm
So if you are passing any option to your script in cron then escape it...
hope this helps...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2003 01:41 AM
02-18-2003 01:41 AM
Re: Crontab probelm
In addition - do you ensure the correct output
for your script in crontab:
00 10 * * *
Regards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2003 05:55 PM
02-18-2003 05:55 PM
Re: Crontab probelm
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x70d0a848deccd61190050090279cd0f9,00.html
Regards
Jim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2003 12:15 AM
02-19-2003 12:15 AM
Re: Crontab probelm
try to run it by doing a su!
e.g. Root's cron and "yd" is the user using which the shell script works (directly)!
5 13 * * 1 echo "/home/yd/myscript.sh"|su - yd 1>/home/yd/output-myscript.crn 2>/home/yd/error-
myscript.crn
#*******************************************************************************
# min|hour |day |month|day |script
# | |of mo| |of wk|
#----|-----|-----|-----|-----|--------------------------------------------------
#*******************************************************************************
#*******************************************************************************
# END OF TABLE day0->Sunday day6->Saturday
#*******************************************************************************
The .crn files will help you troubleshoot any further errors.
Hope this helps!
Best Regards