0

I installed nginxcp (A nginx plugin for cpanel).

They recommend to add the following cron job to clean the temp files.

0 */1 * * * /usr/sbin/tmpwatch -am 1 /tmp/nginx_client

But it does't work. Even running the command /usr/sbin/tmpwatch -am 1 /tmp/nginx_client nothing happens. None of the files are being removed.

The only strange thing I noticed, is that all tmp files that are being stored at /tmp/nginx_client belongs to nobody nobody.

What am I doing wrong?

thanks.

valter
  • 689
  • 5
  • 13
  • 23
  • 1
    a) You're barking up the wrong tree with the nobody.nobody ownership and b) You're not really giving us much to work with. Have the files in question been modified within the last hour? Have you tried using the '-v' verbose options? – Magellan Oct 19 '13 at 17:32
  • I noticed with the --verbose, that it is really deleting some files. But only a few files. But not enough. ngingx_client folder, is growing almost 1GB/hour. The only way to delete them is thru an option on nginxcp control panel. – valter Oct 19 '13 at 18:08

1 Answers1

1

As shown in your question and comments, you've configured tmpwatch to remove all files (-a) that have a modification time (-m) that is older than one hour (1) from the /tmp/nginx_client directory.

As indicated in your comments, a --verbose option indicates that some of those files are being deleted.

Therefore, tmpwatch is behaving correctly and you must look elsewhere in your application to trim the temporary files that are constantly being updated by your application.

If you're still running out of /tmp space, you need to look elsewhere for a solution. This may take the form of fixing poorly thought-out code or in the case of log files using logrotate to truncate the logs.

Magellan
  • 4,431
  • 3
  • 29
  • 53