From 0d9cd6e9f9cc7290e9c38f3c4437f611e67b6101 Mon Sep 17 00:00:00 2001 From: Grant Slater Date: Sun, 17 Aug 2014 10:55:35 +0100 Subject: [PATCH] Remove old planet-notes-dump files --- cookbooks/planet/templates/default/planet-notes-dump.cron.erb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cookbooks/planet/templates/default/planet-notes-dump.cron.erb b/cookbooks/planet/templates/default/planet-notes-dump.cron.erb index 0db348698..f4fa2e7f4 100644 --- a/cookbooks/planet/templates/default/planet-notes-dump.cron.erb +++ b/cookbooks/planet/templates/default/planet-notes-dump.cron.erb @@ -1,2 +1,5 @@ MAILTO=grant-smaug@firefishy.com 0 3 * * * www-data /usr/local/bin/planet-notes-dump + +#Delete Planet Notes dump files older than 8 days +0 8 * * * www-data find /store/planet/notes/20??/ -maxdepth 1 -type f -iname 'planet-notes-??????.osn*' -printf '%T@ %p\n' | sort -k 1nr | sed 's/^[^ ]* //' | tail -n +17 | xargs -r rm -f -- 2.39.5