[freeside-commits] freeside/FS/bin freeside-cdr-sftp_and_import, 1.11.2.3, 1.11.2.4
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-serv6253
Modified Files:
Tag: FREESIDE_2_3_BRANCH
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.11.2.3
retrieving revision 1.11.2.4
diff -u -w -d -r1.11.2.3 -r1.11.2.4
--- freeside-cdr-sftp_and_import 22 Sep 2011 00:32:14 -0000 1.11.2.3
+++ freeside-cdr-sftp_and_import 22 Sep 2011 00:38:39 -0000 1.11.2.4
@@ -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