X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=debian%2Fcron.daily;fp=debian%2Fcron.daily;h=0fe36db8cd302a8a7cf7774e93f3143a3f23cf69;hb=4ce831d591d44c6137d885a44d0ac7d19a09539d;hp=f19666610e3782abb3be52f28e9fb49d581a3117;hpb=cab0e9b3e5654a55a4fd8128ef6ce8f7e029f1de;p=deb_pkgs%2Flibapache-gallery-perl.git diff --git a/debian/cron.daily b/debian/cron.daily index f196666..0fe36db 100644 --- a/debian/cron.daily +++ b/debian/cron.daily @@ -6,18 +6,18 @@ set -e -cachedir=/var/tmp/Apache-Gallery -user=www-data +cachedir="/var/cache/www" +user="www-data" -if [ -d $cachedir ]; then +if [ -d "$cachedir" ]; then # remove old files start-stop-daemon --start --pidfile /dev/null --startas /bin/sh \ - --oknodo --chuid $user -- -c \ - "find $cachedir -type f -atime +6 -print0 | xargs -r0 rm -f" + --oknodo --chuid "$user" -- -c \ + "find '$cachedir' -type f -atime +6 -delete" # remove empty directories start-stop-daemon --start --pidfile /dev/null --startas /bin/sh \ - --oknodo --chuid $user -- -c \ - "find $cachedir -depth -type d -print0 | \ + --oknodo --chuid "$user" -- -c \ + "find '$cachedir' -depth -type d -print0 | \ xargs -r0 rmdir --ignore-fail-on-non-empty" fi