Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Here is the deal. I have two scripts. One is a bash wrapper script that establishes a tunnel, and kicks off the Perl scripts. The second is a Perl script that is in /home/oracle/code/perl/. I will post code below.
- I understand cron uses different permissions and environmental variables. I've tried declaring my Oracle environmental variables in the Bash script, or in the Perl script, or in both...
- Regardless of what I do... the script won't kick off as a cron job. I don't know why. I've got it scheduled properly, because I can see the script act like it's running in /var/log/syslog... I've got an "alarm clock" that plays an MP3 for me to wake up by in the morning...
- I just don't know why this script won't run. It's probably something easy I'm missing. I can run the scripts locally... they both have permissions for the right user, both are executable.
- I will pay for an Amazon Wishlist item for someone that can get this solved for me. Up to $40. /pm me if you're interested, and I'll give you my email address, it's not published here.
- Bash script:
- #!/bin/bash
- # DSTs - script to run Daily System Tests
- echo on
- # Start the first tunnel - run the first script
- ssh -vfNL 1521:foo_ip:2046 admin@barip
- export SSHPROC="$(ps axu | grep -e "ssh -vfNL" | grep -v "grep" | awk '{ print $"2" }')"
- /usr/bin/perl /home/oracle/code/perl/dst_lala.pl &&
- # Start the remaining scripts
- perl /home/oracle/code/perl/dst.pl &&
- # killall -9 ssh
- kill -0 "${SSHPROC}" 2> /dev/null && kill "${SSHPROC}"
- echo off
- Perl script:
- #!/usr/bin/perl
- use Net::Ping;
- @cd_to = ( "foo" );
- @ssh_path = ( "bar" );
- $sql_user = "lala";
- $sql_password = "land";
- foreach ( @ssh_path ) {
- $sitedir = $cd_to[$i];
- chdir "/home/oracle/sql_scripts/".$sitedir;
- system "sqlplus $sql_user/$sql_password\@'$_' @/home/oracle/sql_scripts/blah.sql";
- $element = $ssh_path[$i];
- $i++;
- }
Add Comment
Please, Sign In to add comment