[freeside-commits] branch master updated. bf0217c19f5aeff191fe3354cafe0deaadcf1064

Ivan ivan at 420.am
Mon Mar 6 21:33:27 PST 2017


The branch, master has been updated
       via  bf0217c19f5aeff191fe3354cafe0deaadcf1064 (commit)
      from  2fa0baa6657146fc3569e620945a8fa3dcc9e23d (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit bf0217c19f5aeff191fe3354cafe0deaadcf1064
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Mon Mar 6 21:33:26 2017 -0800

    detect errors on the scp portion of the backup, RT#74914

diff --git a/FS/FS/Cron/backup.pm b/FS/FS/Cron/backup.pm
index a192ca9..7d868c8 100644
--- a/FS/FS/Cron/backup.pm
+++ b/FS/FS/Cron/backup.pm
@@ -58,7 +58,9 @@ sub backup {
   if ( $scpdest ) {
     eval "use Net::SCP qw(scp);";
     backup_log_and_die($filename,$@) if $@;
-    scp("/var/tmp/$database.$ext", "$scpdest/$filename.$ext");
+    my $scp = new Net::SCP;
+    $scp->scp("/var/tmp/$database.$ext", "$scpdest/$filename.$ext")
+      or backup_log_and_die($filename, $scp->{errstr});
   }
 
   unlink "/var/tmp/$database.$ext" or backup_log_and_die($filename,$!); #or just warn?

-----------------------------------------------------------------------

Summary of changes:
 FS/FS/Cron/backup.pm |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)




More information about the freeside-commits mailing list