[freeside-commits] freeside/FS/bin freeside-cdr-sftp_and_import, 1.2, 1.3
Ivan,,,
ivan at wavetail.420.am
Thu Jul 9 16:58:45 PDT 2009
Update of /home/cvs/cvsroot/freeside/FS/bin
In directory wavetail.420.am:/tmp/cvs-serv30174
Modified Files:
freeside-cdr-sftp_and_import
Log Message:
add -r option
Index: freeside-cdr-sftp_and_import
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/bin/freeside-cdr-sftp_and_import,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- freeside-cdr-sftp_and_import 18 May 2009 08:40:00 -0000 1.2
+++ freeside-cdr-sftp_and_import 9 Jul 2009 23:58:43 -0000 1.3
@@ -10,8 +10,8 @@
# parse command line
###
-use vars qw( $opt_p $opt_e $opt_d $opt_v );
-getopts('p:e:d:v');
+use vars qw( $opt_p $opt_r $opt_e $opt_d $opt_v );
+getopts('p:r:e:d:v');
$opt_e ||= 'csv';
#$opt_e = ".$opt_e" unless $opt_e =~ /^\./;
@@ -39,6 +39,9 @@
my $ls_sftp = sftp();
+$ls_sftp->setcwd($opt_r) or die "can't chdir to $opt_r\n"
+ if $opt_r;
+
my $ls = $ls_sftp->ls('.', wanted => qr/^$opt_p.*\.$opt_e$/i );
###
@@ -104,7 +107,7 @@
=head1 SYNOPSIS
- cdr.sftp_and_import [ -p prefix ] [ -e extension ] [ -d donefolder ] [ -v ] user format [sftpuser@]servername
+ cdr.sftp_and_import [ -p prefix ] [ -e extension ] [ -r remotefolder ] [ -d donefolder ] [ -v ] user format [sftpuser@]servername
=head1 DESCRIPTION
@@ -115,6 +118,8 @@
-e: file extension, defaults to .csv
+-r: if specified, changes into this remote folder before starting
+
-d: if specified, moves files to the specified folder when done
-v: verbose
More information about the freeside-commits
mailing list