From f8f2e2063d597045cbbe16b2f7f8b973f1dde77d Mon Sep 17 00:00:00 2001 From: ivan Date: Sat, 23 Oct 2010 21:34:50 +0000 Subject: [PATCH] datestamp backups --- FS/FS/Cron/backup.pm | 1 + bin/freeside-backup | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 bin/freeside-backup diff --git a/FS/FS/Cron/backup.pm b/FS/FS/Cron/backup.pm index 2b16e953a..63f22f737 100644 --- a/FS/FS/Cron/backup.pm +++ b/FS/FS/Cron/backup.pm @@ -3,6 +3,7 @@ package FS::Cron::backup; use strict; use vars qw( @ISA @EXPORT_OK ); use Exporter; +use Date::Format; use FS::UID qw(driver_name datasrc); @ISA = qw( Exporter ); diff --git a/bin/freeside-backup b/bin/freeside-backup new file mode 100644 index 000000000..97a4899e6 --- /dev/null +++ b/bin/freeside-backup @@ -0,0 +1,42 @@ +#!/usr/bin/perl -w + +use strict; +use Getopt::Std; +use FS::UID qw(adminsuidsetup); +use FS::Conf; + +my $user = shift or die &usage; +adminsuidsetup $user; + +#you can skip this just by not having the config +use FS::Cron::backup qw(backup_scp); +backup_scp(); + +sub usage { + die "Usage:\n\n freeside-backup user\n"; +} + +### +# documentation +### + +=head1 NAME + +freeside-backup - Runs a backup + +=head1 SYNOPSIS + + freeside-backup user + +=head1 DESCRIPTION + +Runs a backup. See the dump-scpdest configuration option. + +=head1 BUGS + +=head1 SEE ALSO + +=cut + +1; + -- 2.11.0