On our webserver, we use /tmp to store a server-side cache. The cache path is unique for each website, and also for each git revision. So when the code is updated, the old cache folder is abandoned. The files therein are eventually deleted, but the folders themselves persist. This is not actually causing a problem (yet), but it seems messy. Is there any way to automatically delete folders in /tmp which have been empty for X days?According to the man pages, tmpwatch should remove unused directories, but it is not doing so.$ cat /etc/cron.daily/tmpwatch #! /bin/shflags=-umc/usr/sbin/tmpwatch $flags -x /tmp/.X11-unix -x /tmp/.XIM-unix \    -x /tmp/.font-unix -x /tmp/.ICE-unix -x /tmp/.Test-unix \    -X '/tmp/hsperfdata_*' 10d /tmp/usr/sbin/tmpwatch $flags 30d /var/tmpfor d in /var/{cache/man,catman}/{cat?,X11R6/cat?,local/cat?}; do    if [ -d $d ]; then    /usr/sbin/tmpwatch $flags -f 30d $d    fidoneI see nothing there which would stop it removing directories.However, ls -ul shows that all directories in /tmp (well, all that I checked) have been accessed today, even ones which shouldn't have been touched in months.
When will Cent OS delete empty dirs in /tmp?
centos;tmp