Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have setup a few cronjobs in cPanel and it seems that everytime it runs the scripts, it writes a file to the root folder of that cPanel account. The problem is that the cronjobs run often and therefor there are hundreds of files created daily.

The files it creates are "phpfile.php.1" and "phpfile.php.2" and so on. And they are all completely empty. Here is a screenshot: http://i.stack.imgur.com/kCctw.png

I have also posted about this issue at the official cPanel forums but they have no idea. So im thinking that it must be a setting either in cPanel or WHM that is causing this. Im running Redhat 32bit e5 and I have full root access. Any ideas?

share|improve this question

1 Answer 1

Are you running these crons using wget? I think that you need to send the answer of the wget command to /dev/null with the -O option.

You need to run the cron with this:

wget http://mysite.com/phpfile.php -O /dev/null

Otherwise the wget will write the result of the command on phpfile.php, phpfile.php.1, etcphpfile.php.2, every time it runs. With /dev/null you're discarding the answer and no file is written.

share|improve this answer
    
Yes I am using wget, could you please elaborate on your answer? I am not very experienced with scripting... –  TheBeginning Feb 9 '11 at 17:29

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.