[Pkg-ocaml-maint-commits] [approx] 10/12: use find command to remove old files

Eric Cooper ecc at cmu.edu
Thu Nov 24 18:04:18 UTC 2016


This is an automated email from the git hooks/post-receive script.

ecc-guest pushed a commit to branch master
in repository approx.

commit 3af46a898c7ec2b66e08408888cfd7e7d0fe4d17
Author: Eric Cooper <ecc at cmu.edu>
Date:   Wed Nov 16 16:42:59 2016 -0500

    use find command to remove old files
---
 debian/approx.cron.weekly | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/debian/approx.cron.weekly b/debian/approx.cron.weekly
index 654c3a2..6006a7e 100644
--- a/debian/approx.cron.weekly
+++ b/debian/approx.cron.weekly
@@ -1,7 +1,15 @@
 #!/bin/sh
 
-# Garbage collect the approx(8) cache
+# Remove old files from the approx(8) cache
 
-if [ -x /usr/sbin/approx-gc ]; then
-    nice -n19 ionice -c3 /usr/sbin/approx-gc --quiet
-fi
+# Location of the cache
+cache=/var/cache/approx
+
+# Maximum age of files to keep, in days
+max_age=1000
+
+# Remove old files
+find $cache -type f -mtime +$max_age -delete -print
+
+# Remove empty files and directories
+find $cache -empty -delete

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ocaml-maint/packages/approx.git



More information about the Pkg-ocaml-maint-commits mailing list