The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Cron Jobs creating loads of files

Discussion in 'General Discussion' started by utemplates, Feb 9, 2011.

  1. utemplates

    utemplates Registered

    Joined:
    Feb 9, 2011
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    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?
     
  2. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,478
    Likes Received:
    203
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Can you post what these cronjobs / PHP scripts are setup to actually do? There is no reason for your system to be creating these files, it's executing the cron as you have it setup.
     
  3. utemplates

    utemplates Registered

    Joined:
    Feb 9, 2011
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    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?
     
  4. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,478
    Likes Received:
    203
    Trophy Points:
    63
    Location:
    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.
     
  5. utemplates

    utemplates Registered

    Joined:
    Feb 9, 2011
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    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...
     
  6. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,478
    Likes Received:
    203
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    You'll need to look closer at your script run by the cron. I think thats where your answers are. Good luck!
     
  7. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    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.
     
  8. edlogic

    edlogic Registered

    Joined:
    Feb 15, 2012
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    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]
     
  9. edlogic

    edlogic Registered

    Joined:
    Feb 15, 2012
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    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
     
    #9 edlogic, Feb 15, 2012
    Last edited: Feb 15, 2012
Loading...

Share This Page