[freeside-commits] freeside/FS/FS/Cron backup.pm,1.1,1.2
Ivan,,,
ivan at wavetail.420.am
Sat Oct 23 14:31:51 PDT 2010
Update of /home/cvs/cvsroot/freeside/FS/FS/Cron
In directory wavetail.420.am:/tmp/cvs-serv28183/FS/FS/Cron
Modified Files:
backup.pm
Log Message:
datestamp backups
Index: backup.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/Cron/backup.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -w -d -r1.1 -r1.2
--- backup.pm 1 Feb 2006 23:13:48 -0000 1.1
+++ backup.pm 23 Oct 2010 21:31:48 -0000 1.2
@@ -11,6 +11,7 @@
sub backup_scp {
my $conf = new FS::Conf;
my $dest = $conf->config('dump-scpdest');
+ $dest .= time2str('/%Y%m%d%H%M%S',time);
if ( $dest ) {
datasrc =~ /dbname=([\w\.]+)$/ or die "unparsable datasrc ". datasrc;
my $database = $1;
@@ -30,11 +31,11 @@
recipient => $conf->config('dump-pgpid'),
);
chmod 0600, '/var/tmp/$database.gpg';
- scp("/var/tmp/$database.gpg", $dest);
+ scp("/var/tmp/$database.gpg", "$dest.gpg");
unlink "/var/tmp/$database.gpg" or die $!;
} else {
chmod 0600, '/var/tmp/$database.sql';
- scp("/var/tmp/$database.sql", $dest);
+ scp("/var/tmp/$database.sql", "$dest.sql");
}
unlink "/var/tmp/$database.sql" or die $!;
}
More information about the freeside-commits
mailing list