- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- cron error
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-16-2006 09:59 PM
07-16-2006 09:59 PM
cron error
be CRONned has to be sh shell scripts, like so;
#!/bin/sh
If the script is based on a shell other than sh, e.g. C shell or Korn
shell, then the appropriate CRON entry should be
* * * * * /usr/bin/ksh
or
* * * * * /usr/bin/csh
and not simply
* * * * *
This is because the CRON daemon simply shells the scripts using sh and does not actually fork a seperate shell script process to run the script.
Because I get an error like "sh: ~/spot/startmap.log: cannot create
"
Am I wrong?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2006 10:03 PM
07-16-2006 10:03 PM
Re: cron error
* * * * *
which work fine.
Mark Syder (like the drink but spelt different)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2006 10:05 PM
07-16-2006 10:05 PM
Re: cron error
Remember that when something runs from cron, the environment is very sparse. There is little, or no, PATH environment which is the usual cause of problems.
~/spot/startmap.log:
use the full PATH to the log file, cron does not know what user this is, or set the PATH variables in the beginning of your cron script.
Regards,
Robert-Jan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2006 11:31 PM
07-16-2006 11:31 PM
Re: cron error
cron runs in a basic environment with very little defined.
I always recommend my users run their scripts in a test environment, that has /bin/sh as the shell and litte in the .profile (just as cron will execute the commands).
If you need any environment variables other than the basics ($HOME etc), then run a "setenv" style script that sets up the PATH, ORACLE_SID etc variables.
Also, *ALWAYS* give the full path for all commands in scripts, don't assume that programs such as echo, tar etc will be the correct echos and tars.
I had a user who (when they typed echo) used /usr/bin/echo in their interactive shell, but when they ran their script from cron, it came up with the shell built-in.
And similarly when somebody had several versions of tar in different areas(/opt/bin/tar, /bin/tar). Then gnu tar was added to /usr/local/bin/tar - all of a sudden, the script that called "tar" failed to behave as expected, as /usr/local/bin was first in the PATH.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2006 11:43 PM
07-16-2006 11:43 PM
Re: cron error
Sorry if I'm stating the obvious, but check that '~/spot/startmap.log' is what you want, and not '~spot/startmap.log'.
As others have said, check that your environmental variables are set up properly. If you're looking to test variables from cron, create a script that echos the variables in question, and read the output. For a more generic approach, you could put environmental variables in a file, and source that file from scripts you run as cron or other users.
PCS