projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
5efeb63
)
detect errors on the scp portion of the backup, RT#74914
author
Ivan Kohler
<ivan@freeside.biz>
Tue, 7 Mar 2017 05:33:37 +0000
(21:33 -0800)
committer
Ivan Kohler
<ivan@freeside.biz>
Tue, 7 Mar 2017 05:33:37 +0000
(21:33 -0800)
FS/FS/Cron/backup.pm
patch
|
blob
|
history
diff --git
a/FS/FS/Cron/backup.pm
b/FS/FS/Cron/backup.pm
index
cfc8e36
..
6e172ae
100644
(file)
--- 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_email_and_die($conf,$filename,$@) if $@;
if ( $scpdest ) {
eval "use Net::SCP qw(scp);";
backup_email_and_die($conf,$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_email_and_die($conf, $filename, $scp->{errstr});
}
unlink "/var/tmp/$database.$ext" or backup_email_and_die($conf,$filename,$!); #or just warn?
}
unlink "/var/tmp/$database.$ext" or backup_email_and_die($conf,$filename,$!); #or just warn?