- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- crontab Perl scrip
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
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-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
- 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
- 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
- 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
- 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
- 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
- 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