Bug 2389: (followup) Add documentation and fix use case
authorTomas Cohen Arazi <tomascohen@theke.io>
Tue, 13 Sep 2016 17:42:32 +0000 (14:42 -0300)
committerKyle M Hall <kyle@bywatersolutions.com>
Sat, 24 Sep 2016 16:27:11 +0000 (16:27 +0000)
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Barton Chittenden <barton@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
misc/cronjobs/overdue_notices.pl

index 0b9d623..7504c7a 100755 (executable)
@@ -69,6 +69,7 @@ overdue_notices.pl
    -borcat       <categorycode>   category code that must be included
    -borcatout    <categorycode>   category code that must be excluded
    -t                             only include triggered overdues
+   --test                         Run in test mode. No changes will be made on the DB.
    -list-all                      list all overdues
    -date         <yyyy-mm-dd>     emulate overdues run for this date
    -email        <email_type>     type of email that will be used. Can be 'email', 'emailpro' or 'B_email'. Repeatable.
@@ -159,6 +160,13 @@ the  cron schedule to ensure proper behavior.
 Add the --triggered option for daily cron, at the risk of no notice 
 being generated if the cron fails to run on time.
 
+=item B<-test>
+
+This option makes the script run in test mode.
+
+In test mode, the script won't make any changes on the DB. This is useful
+for debugging configuration.
+
 =item B<-list-all>
 
 Default items.content lists only those items that fall in the 
@@ -813,7 +821,7 @@ END_SQL
                 attachments            => [$attachment],
                 to_address             => $admin_email_address,
             }
-        );
+        ) unless $test_mode;
     }
 
 }