Over a year ago we had someone install Nginx on our dedicated server that hosts quite a busy Forum.
Cut a long story short I've found the nginx_client has masses of files in the directory.
At the moment I'm trying to empty the directory via terminal: -
root@server [~]# cd /home
root@server [/home]# ls
./ .cpan/ cpeasyapache/ munin/ oeallian/
../ .cpanm/ cpins/ MySQL-install/ quota.user*
aquota.user* .cpcpan/ lost+found/ nginx_client/ worldsat/
root@server [/home]# cd nginx_client
root@server [/home/nginx_client]# rm -rf ./*
The above has been now running for four hours and still not emptied the directory.
I briefly spoke to the guy who installed Nginx (who's not being very helpful now) he tell's there was a cron job in place to clean the directory.
I remember when the guy installed nginx he had to put nginx_client directory in /home, due to it filling /tmp to fast, so I think the cronjob was never setup correctly.
Crontab has the following: -
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/
# run-parts
01 * * * * root run-parts /etc/cron.hourly
02 4 * * * root run-parts /etc/cron.daily
22 4 * * 0 root run-parts /etc/cron.weekly
42 4 1 * * root run-parts /etc/cron.monthly
I've found tmpwatch in /etc/cron.daily
flags=-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_*' 240 /tmp
/usr/sbin/tmpwatch "$flags" 720 /var/tmp
for d in /var/{cache/man,catman}/{cat?,X11R6/cat?,local/cat?}; do
if [ -d "$d" ]; then
/usr/sbin/tmpwatch "$flags" -f 720 "$d"
fi
done
I'm no expert coder and am very lost with this. Cleary the above is not going to empty /home/nginx_client.
Please can anybody help me empty the directory nginx_client faster, at the moment its taking hours and still not empty. Also please help me with the correct cron command to clean it daily.
Thank you in advance.