Cron Jobs creating loads of files

utemplates

Registered
Feb 9, 2011
3
0
51
I have 5 cronjobs setup in cpanel that runs a few php scripts every half an hour. I have noticed that in the root of that cpanel account, there are loads of files created named "phpfile.php.1" and "phpfile.php.2" and so on. Is these logs?

What ever they are, is there anyway to make cpanel stop creating these files?
 

utemplates

Registered
Feb 9, 2011
3
0
51
Thanks for the quick respond. Well the php scripts updates view counts and similar statistics that the website display on video sections. Nothing major. I am confident that the php scripts are not the cause of this.

Also to note, I have hosted the website in three different servers so far and they all produce these annoying files. What I am thinking is that maybe there is a setting somewhere that logs everything? Or that everytime it runs the php script, it has to create a new one, resulting in an added number: "phpfilename.php.3". I am certain that that is happening but I cannot determind why.

Any ideas please?
 

Infopro

Well-Known Member
May 20, 2003
17,075
524
613
Pennsylvania
cPanel Access Level
Root Administrator
Twitter
You might open one of these auto created files and check the contents of it to see if it gives any clues. Also, you might check the php script the cron runs for any sort of code that clues you in on when and why it's creating these dummy files. If thats what they are.

Sorry I can't help more than that, but this doesn't sound like any sort of issue with your cPanel.
 

utemplates

Registered
Feb 9, 2011
3
0
51
Well I have opened them. They are all completely empty. Not that this will help much but here is a screenshot:
http://i.imgur.com/kCctw.png

As I mentioned earlier, I am certain that there must be a setting either in cPanel or WHM that is causing this. I am shocked that there arent other users with the same issue...
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
43
348
somewhere over the rainbow
cPanel Access Level
Root Administrator
Hello utemplates,

Can you please provide an example of the cron job script you are running as well as the command being used to execute the cron. It has to be specific to the script as I've never heard this happening before for a cron job on a cPanel machine or otherwise. The only way to track it down is to see the actual script you are cronning so we can see what it is doing.

Thanks.
 

edlogic

Registered
Feb 15, 2012
2
0
51
cPanel Access Level
Website Owner
i am having the same trouble -

the command that i am using on the cron is

wget /http://www.mywifeissodumb.com/forum/cronrss.php

the php script retrieves news feed info and creates forum postings

the files created in the main directory seem to have output information :

example 1 :

Code:
<br />
<b>Warning</b>:  fsockopen() [<a href='function.fsockopen'>function.fsockopen</a>]: php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in <b>/home/mhddom/public_html/forum/Sources/Subs-RSS2.php</b> on line <b>435</b><br />
<br />
<b>Warning</b>:  fsockopen() [<a href='function.fsockopen'>function.fsockopen</a>]: unable to connect to  http:80 (php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution) in <b>/home/mhddom/public_html/forum/Sources/Subs-RSS2.php</b> on line <b>435</b><br />
Feed Poster Configuration
example 2 :

Feed Poster Configuration

the text seen in example 2 is the same text that you see in your browser when you access that url

i tried putting
> /dev/null
and
> /dev/null 2>&1
(that is what the cpanel suggested )

here is what it says in cpanel just above the email address input

'
You can have cron send an email everytime it runs a command. If you do not want an email to be sent for an individual cron job you can redirect the command's output to /dev/null like this: mycommand >/dev/null 2>&1
'
the email i am getting has this info ( you can see it says saving to - )
Code:
--2012-02-15 22:15:01--  /http://www.mywifeissodumb.com/forum/cronrss.php
Resolving /http://www.mywifeissodumb.com... 69.65.49.32
Connecting to mywifeissodumb.com|69.65.49.32|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 581 [text/html]
Saving to: `cronrss.php.2'

     0K                                                       100% 61.6M=0s

2012-02-15 22:15:24 (61.6 MB/s) - `cronrss.php.2' saved [581/581]
 

edlogic

Registered
Feb 15, 2012
2
0
51
cPanel Access Level
Website Owner
i found the answer on another web site - they say put
-O /dev/null
at the end of your cron text

it worked for me

my cpanel instructions have the wrong info - i guess i should contact the web host
 
Last edited: