- Community Home
- >
- Servers and Operating Systems
- >
- Operating System - Linux
- >
- General
- >
- crontab Perl scrip
-
- Forums
-
- Advancing Life & Work
- Advantage EX
- Alliances
- Around the Storage Block
- HPE Ezmeral: Uncut
- OEM Solutions
- Servers & Systems: The Right Compute
- Tech Insights
- The Cloud Experience Everywhere
- HPE Blog, Austria, Germany & Switzerland
- Blog HPE, France
- HPE Blog, Italy
- HPE Blog, Japan
- HPE Blog, Middle East
- HPE Blog, Latin America
- HPE Blog, Russia
- HPE Blog, Saudi Arabia
- HPE Blog, South Africa
- HPE Blog, UK & Ireland
-
Blogs
- Advancing Life & Work
- Advantage EX
- Alliances
- Around the Storage Block
- HPE Blog, Latin America
- HPE Blog, Middle East
- HPE Blog, Saudi Arabia
- HPE Blog, South Africa
- HPE Blog, UK & Ireland
- HPE Ezmeral: Uncut
- OEM Solutions
- Servers & Systems: The Right Compute
- Tech Insights
- The Cloud Experience Everywhere
-
Information
- Community
- Welcome
- Getting Started
- FAQ
- Ranking Overview
- Rules of Participation
- Tips and Tricks
- Resources
- Announcements
- Email us
- Feedback
- Information Libraries
- Integrated Systems
- Networking
- Servers
- Storage
- Other HPE Sites
- Support Center
- Aruba Airheads Community
- Enterprise.nxt
- HPE Dev Community
- Cloud28+ Community
- Marketplace
-
Forums
-
Blogs
-
Information
-
English
- 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
- Email to a Friend
- Report Inappropriate Content
02-16-2011 12:17 AM
02-16-2011 12:17 AM
crontab Perl scrip
how can I run a perl script from crontab?
BR
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
02-16-2011 12:19 AM
02-16-2011 12:19 AM
Re: crontab Perl scrip
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
02-16-2011 12:58 AM
02-16-2011 12:58 AM
Re: crontab Perl scrip
just be sure you have full path to perl binary in your command or in the first line of your script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
02-16-2011 11:03 PM
02-16-2011 11:03 PM
Re: crontab Perl scrip
in cron:
* * * * * /u01/app/oracle/product/10.2.0/db_1/perl/bin/perl /usr/OVPI/connect.pl >>& /usr/OVPI/test_perl.txt
does not write any in the file /usr/OVPI/test_perl.txt
but when I run it in the shell it is OK
BR
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
02-17-2011 04:27 AM
02-17-2011 04:27 AM
Re: crontab Perl scrip
Do you realy mean to background the connect.pl command?
Or did you just want to redirect both stdout and stderr to test_perl.txt?
Then I think it would have to be
* * * * * /u01/app/oracle/product/10.2.0/db_1/perl/bin/perl /usr/OVPI/connect.pl &>>/usr/OVPI/test_perl.txt
But check with man bash in the section REDIRECTIONS if this abbreviated syntax is valid.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
02-17-2011 06:10 AM
02-17-2011 06:10 AM
Re: crontab Perl scrip
and AFAIK it should be
/u01/app/oracle/product/10.2.0/db_1/perl/bin/perl /usr/OVPI/connect.pl >> /usr/OVPI/test_perl.txt
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
02-17-2011 11:40 AM
02-17-2011 11:40 AM
Re: crontab Perl scrip
the problem is resolved when I fixed the Oracle home environment variables in the perl script, as follow:
------------
BEGIN {
unless ($ENV{ORACLE_PERL}) {
$ENV{ORACLE_HOME} = "/u01/app/oracle/product/10.2.0/db_1";
$ENV{ORACLE_PERL} = "$ENV{ORACLE_HOME}/perl";
$ENV{PERL5LIB} = "$ENV{PERL5LIB}:$ENV{ORACLE_PERL}/lib:$ENV{ORACLE_PERL}/lib/site_perl";
$ENV{LD_LIBRARY_PATH} = "$ENV{LD_LIBRARY_PATH}:$ENV{ORACLE_HOME}/lib32:$ENV{ORACLE_HOME}/lib";
exec "$ENV{ORACLE_PERL}/bin/perl", $0, @ARGV;
}
}
------------
Thank you all
Hewlett Packard Enterprise International
- Communities
- HPE Blogs and Forum
© Copyright 2021 Hewlett Packard Enterprise Development LP