- Community Home
- >
- Servers and Operating Systems
- >
- Legacy
- >
- Operating System - Tru64 Unix
- >
- Cron problems running a Perl 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
Discussions
Discussions
Discussions
Forums
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
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-12-2009 01:11 PM
тАО02-12-2009 01:11 PM
Cron problems running a Perl script
I have a strange problem on a new Tru64 host I am configuring. I am attempting to run a simple Perl script from cron:
* * * * * /tmp/test.pl >> /tmp/test.log 2>&1
The output file contains no records, and cron log shows:
< testuser 296824 cr /tmp/test.pl >> /tmp/test.log 2>&1 rc=1 Fri Feb 13 07:02:00 2009
The contents of the Perl script is as follows, has correct permissions and runs OK interactively:
#!/usr/local/bin/perl -w
print "This is a test ";
exec ('date');
Obviously, rc=1 an error is occurring preventing my script from running.
I have tested the script and cron entries against another Tru64 host and a HP-UX host - both return expected results in the /tmp/test.log file.
I can force cron to run the script by changing the cron entry to:
/bin/ksh -c ". /etc/profile;/tmp/test.pl" >> /tmp/test.log 2>&1
My frustration is that I don't have to change the cron entry on my other test boxes to get the environment set up correctly. There's a difference in the OS environment setup on the new Tru64 host I am intalling ... where do I start looking?!?
Points gratefully awarded for any help!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-12-2009 02:09 PM
тАО02-12-2009 02:09 PM
Re: Cron problems running a Perl script
I haven't tested your script, but I'll guess that this is an environment thing...
Try changing date to /usr/bin/date (or wherever date lives...)
Hope this helps,
Regards,
Rob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-12-2009 02:42 PM
тАО02-12-2009 02:42 PM
Re: Cron problems running a Perl script
The script doesn't seem to invoke at all - the print command does not return any output
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-12-2009 08:52 PM
тАО02-12-2009 08:52 PM
Re: Cron problems running a Perl script
/bin/ksh -c ". /etc/profile;/tmp/test.pl"
This is one solution if you need your profile.
You could also create a ksh script that looks what variables are set and see which one perl needs, by trial and error.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-13-2009 12:48 AM
тАО02-13-2009 12:48 AM
Re: Cron problems running a Perl script
Permissions on the log file maybe ?
Or maybe perl isn't in /usr/local/bin, although I'd expect that to cause it to fail interactively...
Cheers,
Rob