Ubuntu: tmpreaper Cannot chdir() to `/tmp/



Question:

My friend and me run a website hosted on an Ubuntu VDS. None of us is sys-admin. The site use an ImageMagick tool for PDF to PNG conversions. This fills the /tmp/ folder with tons of big temporary files and quickly finishes the available disk space.

I recently found a tmpreaper utility. Installed it, and following the instructions, removed the "SHOWWARNING=true" from the /etc/tmpreaper.conf file in order to run it daily to clean the /tmp/ folder. After the nightly cron I got a mail saying:

error: Cannot chdir() to `/tmp/. ' for --protect glob: No such file or directory

I tried to connect to the server with PuTTY as root user and run tmpreaper with "--test 1d /tmp/" arguments and it seems to work properly, without any error messages.

Please help me to configure the tmpreaper to run properly. Or any other ideas how to deal with this temporary files. Thank you.


Solution:1

The problem is solved. The problem was caused by the fact that I have edited the above mentioned /etc/tmpreaper.conf file by using a web-based text editor which is built-in into the "Parallels Power Panel" file manager, which, as it turned out, for some reason, uses a Windows-style line breaks (\r\n) instead of a Unix-style ones (\n). So the program was actually trying to change a dir to a "/tmp/\r". Yesterday I downloaded the conf file, edited it locally, saved with a Unix-style line breaks, uploaded it back, and the program worked properly.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »