- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- about crontab job
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
06-25-2003 05:14 AM
06-25-2003 05:14 AM
about crontab job
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2003 05:17 AM
06-25-2003 05:17 AM
Re: about crontab job
cron environment is completly different from shell. Make sure you give the whole path of the file and command also (if its not in /usr/bin) in crontab.
HTH,
Umapathy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2003 05:21 AM
06-25-2003 05:21 AM
Re: about crontab job
First of all where is the command sz ?
/usr/local/bin/sz ???
second use this
* * * * * "/???/sz -a /tmp/*" > /dev/null 2>&1
Hope it helps,
Robert-Jan.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2003 05:21 AM
06-25-2003 05:21 AM
Re: about crontab job
in addition to Umaphaty's suggestion, it's best not to use wildcards in crontab, sometimes you can incur into problem.
And i suggest you to change the location of the file source: in HPUX /tmp is used for almost anything, you may download much more than needed.
HTH,
Massimo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2003 05:23 AM
06-25-2003 05:23 AM
Re: about crontab job
The most common reason a script works from a shell session but not when 'cron'ed is the sparse environment 'cron' offers. Most notably, 'cron' supplies only the environmental variables HOME (the user's-home-directory), LOGNAME, a PATH consisting of (only) '/usr/bin:/usr/sbin:' and a SHELL variable of '/usr/bin/sh'. This means that your '$HOME/.profile' with any/all of the variables you may define, is *not* offered to the crontas's environment.
One workaround is to source (read) your $HOME/.profile as part of the crontask. A better solutino is to declare *all* the variables you need within your script or within a file that your script sources (reads) as it begins executing.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2003 05:26 AM
06-25-2003 05:26 AM
Re: about crontab job
Cron must have all the environmental variables it requires set.
Also in your script give the full path to every command.
When using cron
One to watch out for is:-
WRONG
cd /
rm *
RIGHT
rm /
If the cd fails then the rm will be done in root dir.
Paula
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2003 05:28 AM
06-25-2003 05:28 AM
Re: about crontab job
* * * * * /usr/bin/sz -a /tmp/*
And I usually create a script to do so, export the search path and related environment variables in the script, like this(.cronprofile export all variables):
. .cronprofile
/usr/bin/sz -a /tmp/*