aboutsummaryrefslogtreecommitdiffstats
path: root/bin/process-inactive-reports
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2018-05-24 10:33:05 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2018-05-24 10:33:05 +0100
commit72ab2740e2c8c24e62b6e9d98f686498b1225b09 (patch)
tree4e0260c14afbbdcd79ebe66f09aa37d9af509157 /bin/process-inactive-reports
parentda305260b4db386af9fb2c48d9055a2934069c84 (diff)
parentec4fb8fe445efd5cb584ac7021707c41a0188cdb (diff)
Merge branch 'user-inactivity'
Diffstat (limited to 'bin/process-inactive-reports')
-rwxr-xr-xbin/process-inactive-reports41
1 files changed, 41 insertions, 0 deletions
diff --git a/bin/process-inactive-reports b/bin/process-inactive-reports
new file mode 100755
index 000000000..d2c030c2c
--- /dev/null
+++ b/bin/process-inactive-reports
@@ -0,0 +1,41 @@
+#!/usr/bin/env perl
+
+use v5.14;
+use warnings;
+
+BEGIN {
+ use File::Basename qw(dirname);
+ use File::Spec;
+ my $d = dirname(File::Spec->rel2abs($0));
+ require "$d/../setenv.pl";
+}
+
+use Getopt::Long;
+use FixMyStreet::Script::Inactive;
+use Pod::Usage;
+
+my %h;
+GetOptions(\%h, 'anonymize=i', 'close=i', 'verbose|v', 'help|h', 'dry-run|n');
+pod2usage(0) if $h{help};
+pod2usage(1) unless $h{anonymize} || $h{close};
+
+FixMyStreet::Script::Inactive->new(%h)->reports;
+
+__END__
+
+=head1 NAME
+
+process-inactive-reports - deal with anonymizing inactive non-open reports
+
+=head1 SYNOPSIS
+
+process-inactive-reports [--anonymize N] [--close N]
+
+ Options:
+ --anonymize Anonymize non-open reports (and related) inactive longer than this time (months)
+ --close Close comments on non-open reports inactive longer than this time (months)
+ --dry-run Don't actually anonymize anything or send any emails
+ --verbose Output as to which reports are being affected
+ --help This help message
+
+=cut