OT(sort of): Filepro running SCP via perl script
Doug Luurs
doug.luurs at gmail.com
Tue Aug 5 11:20:36 PDT 2008
I've been converting a LOT of our reports from paper to PDF/Copy to Windows
FileServer.
The below script runs great for us to copy .PDF / .XLS files created by (SCO
6) filepro for normal level users.
My problem is .. If root attempts to run a report & copy the .PDF to the
FileServer, it crashs on the
system ( $command ) line. No output, no nothing.
Anyone have any idea what might cause the script to crash out ?
Software Rev's
sco 5v6.0.0
filepro 5.6.06K7D4
perl 5.8.7 (i586-pc-sysv5)
Thanks in Advances
Doug
- Filepro Code -
( pn { fn is /appl/fpmerge/excellist2 )
212 ------- - - - - - - - - - - - - - - - -
If:
Then: xx="/appl/scripts/scpreport" < pn { fn {".pdf HRR"
213 ------- - - - - - - - - - - - - - - - -
If:
Then: xy = system( xx )
- script ( /appl/scripts/scpreport ) -
*#! /bin/perl*
*use File::HomeDir;*
* *
*$ENV{PATH} = "/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/gnu/bin";*
*$< = $>; # Real UID = Effective UID*
* *
*unless( $#ARGV + 1 == 2 ) {*
* print "Incorrect number of arguments.\n";*
* print "Usage:\n";*
* die " scpreport source destination\n";*
*}*
*$dst_file = $ARGV[1];*
* *
*if ($src_file =~ /^([-\/\@\w.]+)$/) {*
* $src_file = $1;*
* } else {*
* die "Bad Data in Source : $src_file";*
* }*
* *
*if ($dst_file =~ /^([-\/\@\w.]+)$/) {*
* $dst_file = $1;*
* } else {*
* die "Bad Data in Destination: $dst_file";*
* }*
* *
*$identity = home( 'filepro' ) . "/.ssh/id_rsa";*
*$command = "/bin/scp " .*
* "-q **-i $identity **$src_file filepro\@FileServer01:/public/$dst_file "
;*
* *
*if( system( $command ) ) {*
* print " FAILED!!!\n";*
* die "unable to execute $command\n";*
*} else {*
* print " Done\n";*
*}*
**
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.celestial.com/pipermail/filepro-list/attachments/20080805/8a811d07/attachment.html
More information about the Filepro-list
mailing list