]> git.donarmstrong.com Git - deb_pkgs/libapache-gallery-perl.git/blob - debian/cron.daily
fixup for 1.0.2 release; use dh 8, mark conffiles
[deb_pkgs/libapache-gallery-perl.git] / debian / cron.daily
1 #!/bin/sh
2 #
3 # libapache-gallery-perl cleanup
4 # Remove all files in $cachedir that have not been accessed in a week,
5 # then remove empty directories.  Run as user $user.
6
7 set -e
8
9 cachedir="/var/cache/www"
10 user="www-data"
11
12 if [ -d "$cachedir" ]; then
13     # remove old files
14     start-stop-daemon --start --pidfile /dev/null --startas /bin/sh \
15         --oknodo --chuid "$user" -- -c \
16         "find '$cachedir' -type f -atime +6 -delete"
17     # remove empty directories
18     start-stop-daemon --start --pidfile /dev/null --startas /bin/sh \
19         --oknodo --chuid "$user" -- -c \
20         "find '$cachedir' -depth -type d -print0 | \
21          xargs -r0 rmdir --ignore-fail-on-non-empty"
22 fi
23
24 exit 0