- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Cron job problem
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
09-08-2003 02:27 AM
09-08-2003 02:27 AM
Cron job problem
I have an entry in the cron job as follows:
0 13 * * 1 rsync -arvz /afs/sie.intel.com/cad/sun4x_57/xscale/windriver/2.2.1/docs/usb/ /pgfs2/sws1/CSR/users/cloh6/usb/ > /pgfs2/eng/cloh6/syncout0
It somehow fails to execute the rsync command above at the specified time. Hence the job did not get executed at all.
The rsync command did get run when it was invoked from the command line.
I was wondering if anyone does have any ideas on the cause of this problem & the method of solving it?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-08-2003 02:37 AM
09-08-2003 02:37 AM
Re: Cron job problem
Cron jobs have minimal environements (i.e. not PATH, few variables set, etc.). Try the full path name for the rsync command.
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-08-2003 02:37 AM
09-08-2003 02:37 AM
Re: Cron job problem
Edited version:
Cron jobs have minimal environments (i.e. not much of a PATH, few variables set, etc.). Try the full path name for the rsync command.
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-08-2003 03:08 AM
09-08-2003 03:08 AM
Re: Cron job problem
sh: rsync: not found.
I guess rsync, as Pete wrote, isn't in one of the standard paths cronjobs are furnished with like /usr/bin.
In the shell where you successfully issued the rsync command what does your PATH look like, or what is a "which rsync" responding?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-08-2003 03:14 AM
09-08-2003 03:14 AM
Re: Cron job problem
after the script supposed to run you can check it under /tmp if the file has been created.
the others a right as well. For cron you should think of the enviroment.
Maybe don't trigger the sync via cron, trigger a other script which triggers the sync. Within this script you can parse the env.
But don't forgett to use a absolute path for it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-08-2003 03:27 AM
09-08-2003 03:27 AM
Re: Cron job problem
As Pete wrote it's common problem when you start scripts from crontab. In addition , from my experience if you use some variables in your script, put in the beginning line
. /home/user/profile
or special cron-profile (file where you can specify PATH, variables, ORACLE_HOME .....)
. /home/user/cronprofile
HTH
Radim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-08-2003 03:33 AM
09-08-2003 03:33 AM
Re: Cron job problem
I have two sessions open as the user.
One session edits the script, the other issues the whence command for every command I plan to use.
All commands are done with the full path of the command. It would be easier to set the PATH variable, but that leaves open the possbility that the PATH variable can be changed by the cron script itself.
An OS upgrade can mess up scripts by moving the commands themselves, but I get warning on that and can either use sed to change all user contributed scripts, or softlink to the new command area when that happens.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-08-2003 04:37 AM
09-08-2003 04:37 AM
Re: Cron job problem
I mention this because we tend to not check "root"'s email on our system and then every once in a while we do and usually find old cron job errors :-)
Best regards,
Kent M. Ostby
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-08-2003 08:02 PM
09-08-2003 08:02 PM
Re: Cron job problem
The email which I obtained did not indicate the which command in the crontab produced the error.
The error which message obtained from the e-mail is:
Subject: Your crontab file has an error in it
Your "crontab" on pgsc2603
unexpected end of line
This entry has been ignored.
Is there a way which to run the crontab in a verbose mode i.e. displaying the error message occuring at a specific command?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-09-2003 04:10 AM
09-09-2003 04:10 AM
Re: Cron job problem
Try this. Put this on the bottom of your crontab file for a second
* * * * /usr/bin/env > /tmp/crontab.env
Wait until /tmp/crontab.env gets created.
Run /usr/bin/env > /tmp/my.env
(remove the /usr/bin/env from the crontab file now).
Then look at both files. If it runs by hand, and not by cron, the differences here could be why rsync fails to run.
IF it's not the environment, maybe there's something different on the system at 1300 hours?
steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-09-2003 04:14 AM
09-09-2003 04:14 AM
Re: Cron job problem
It's complaining about an unexpected end of line. Unfortunately, the forums formatting makes your crontab entry difficult to read in your original post. Could you attache the actual crontab entry so we can better see it?
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-09-2003 04:16 AM
09-09-2003 04:16 AM
Re: Cron job problem
Try to delete the line completely and type it in again (don't paste it from your clipboard).
greets
Wout