From c7ab934cc0b83600b1ccbb177b2e2d7aa37ed2ce Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Sat, 1 Apr 2017 13:20:24 -0700 Subject: [PATCH] add option to disable backup so two runs of freeside-daily with -m don't write to the same file --- FS/bin/freeside-daily | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/FS/bin/freeside-daily b/FS/bin/freeside-daily index e21569d4b..eb1a3e347 100755 --- a/FS/bin/freeside-daily +++ b/FS/bin/freeside-daily @@ -8,7 +8,7 @@ use FS::Log; &untaint_argv; #what it sounds like (eww) use vars qw(%opt); -getopts("p:a:d:vl:sy:nmrkg:o", \%opt); +getopts("p:a:d:vl:sy:nmrkg:ox", \%opt); my $user = shift or die &usage; adminsuidsetup $user; @@ -87,9 +87,9 @@ use FS::Cron::cleanup qw( cleanup cleanup_before_backup ); cleanup_before_backup(); #backup should be last -#you can skip this just by not having the config +#you can skip this just by not having the config (or with the -x option) use FS::Cron::backup qw(backup); -backup(); +backup() unless $opt{'x'}; #except we'd rather not start cleanup jobs until the backup is done cleanup(); @@ -110,7 +110,7 @@ sub untaint_argv { } sub usage { - die "Usage:\n\n freeside-daily [ -d 'date' ] [ -y days ] [ -p 'payby' ] [ -a agentnum,agentnum,... ] [ -s ] [ -v ] [ -l level ] [ -m ] [ -k ] user [ custnum custnum ... ]\n"; + die "Usage:\n\n freeside-daily [ -d 'date' ] [ -y days ] [ -p 'payby' ] [ -a agentnum,agentnum,... ] [ -s ] [ -v ] [ -l level ] [ -m ] [ -k ] [ -x ] user [ custnum custnum ... ]\n"; } ### @@ -166,7 +166,9 @@ the bill and collect methods of a cust_main object. See L. -k: skip notify_flat_delay -user: From the mapsecrets file - see config.html from the base documentation + -x: skip backup + +user: Typically "fs_daily" custnum: if one or more customer numbers are specified, only bills those customers. Otherwise, bills all customers. -- 2.11.0