[freeside-commits] freeside/FS/bin freeside-cdr-sftp_and_import, 1.14, 1.15
Ivan,,,
ivan at wavetail.420.am
Wed Sep 21 17:38:41 PDT 2011
Update of /home/cvs/cvsroot/freeside/FS/bin
In directory wavetail.420.am:/tmp/cvs-serv6252
Modified Files:
freeside-cdr-sftp_and_import
Log Message:
add datestamp to batch name derived from filename, remove temp files for all errors that abort processing, RT#14385
Index: freeside-cdr-sftp_and_import
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/bin/freeside-cdr-sftp_and_import,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -w -d -r1.14 -r1.15
--- freeside-cdr-sftp_and_import 22 Sep 2011 00:32:13 -0000 1.14
+++ freeside-cdr-sftp_and_import 22 Sep 2011 00:38:38 -0000 1.15
@@ -105,10 +105,12 @@
}
}
+ my $file_timestamp = $filename.'-'.time2str('%Y-%m-%d', time);
+
my $import_options = {
'file' => "$cachedir/$ungziped",
'format' => $format,
- 'batch_namevalue' => $filename.'-'.time2str('%Y-%m-%d', time),
+ 'batch_namevalue' => $file_timestamp,
'empty_ok' => 1,
};
$import_options->{'cdrtypenum'} = $opt_c if $opt_c;
@@ -123,7 +125,7 @@
if ( $opt_d ) {
if($opt_m eq 'ftp') {
my $ftp = ftp();
- $ftp->rename($filename, "$opt_d/$filename")
+ $ftp->rename($filename, "$opt_d/$file_timestamp")
or do {
unlink "$cachedir/$filename";
unlink "$cachedir/$ungziped" if $opt_g;
@@ -132,7 +134,7 @@
}
else {
my $sftp = sftp();
- $sftp->rename($filename, "$opt_d/$filename")
+ $sftp->rename($filename, "$opt_d/$file_timestamp")
or do {
unlink "$cachedir/$filename";
unlink "$cachedir/$ungziped" if $opt_g;
More information about the freeside-commits
mailing list