From d7b063a2498ea9e41ebda90ebc52c22e992f3b37 Mon Sep 17 00:00:00 2001 From: Florian Schlichting Date: Fri, 2 Oct 2015 22:44:51 +0200 Subject: [PATCH] fix default value for old events, and actually bail out if "old" is less than six days ago (fixes #49) --- scripts/archive-old-events.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/scripts/archive-old-events.php b/scripts/archive-old-events.php index ba542278..028f0681 100755 --- a/scripts/archive-old-events.php +++ b/scripts/archive-old-events.php @@ -1,7 +1,7 @@ #!/usr/bin/env php debug = false; $args->principal = false; $args->collection = false; -$args->older = 'P190D'; +$args->older = 'P-190D'; $args->delete = false; $args->archive_suffix = 'archive'; $debugging = null; @@ -113,7 +113,8 @@ $recent->modify('P-6D'); $archive_before_date = new RepeatRuleDateTime(gmdate('Ymd\THis\Z')); $archive_before_date->modify( $args->older ); if ( $archive_before_date > $recent ) { - echo "Cowardly refusing to archive events before "+$archive_before_date->format('Y-m-d H:i:s') + "\n"; + echo "Cowardly refusing to archive events before " . $archive_before_date->format('Y-m-d H:i:s') . "\n"; + exit(1); }