Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

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 is creating empty files, how to stop this?

Discussion in 'General Discussion' started by h0feer, Mar 8, 2017.

  1. h0feer

    h0feer Member

    Joined:
    Nov 24, 2016
    Messages:
    15
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    serbia
    cPanel Access Level:
    Root Administrator
    Hello to everyone,


    I'm using Cron from cPanel to complete some automatic tasks to my website , i have setup the cron command like this :


    Code:
    * * * * * wget -q https://www.mydomain.com/cron/WonProductNotification >/dev/null 2>&1
    and each time it's completing the task it's creating files like this "WonProductNotification" with empty content, yesterday i couldn't even login to my server using ftp because of these much files that was created by cron , around 50k files ..

    Can someone tell me what to do in this case? how to make cron do it's job without creating these files?


    I already tried to change the command like this "wget -O link >/dev/null 2>&1 but cron is not working then after i change from -q to O ,

    can someone help me please?


    Thanks in advance.
     
    #1 h0feer, Mar 8, 2017
    Last edited by a moderator: Mar 8, 2017
  2. vacancy

    vacancy Well-Known Member

    Joined:
    Sep 20, 2012
    Messages:
    140
    Likes Received:
    14
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Did you try this way?

    Code:
    wget --quiet -O

    or

    Code:
    wget -q --spider
     
  3. h0feer

    h0feer Member

    Joined:
    Nov 24, 2016
    Messages:
    15
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    serbia
    cPanel Access Level:
    Root Administrator
    Hi, thanks for your reply.

    please explain it a little bit clear , you mean try like this :
    Code:
    wget --quiet -O https://www.mydomain.com/cron/WonProductNotification >/dev/null 2>&1
     
    #3 h0feer, Mar 8, 2017
    Last edited by a moderator: Mar 8, 2017
  4. vacancy

    vacancy Well-Known Member

    Joined:
    Sep 20, 2012
    Messages:
    140
    Likes Received:
    14
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Code:
    * * * * * wget --quiet -O https://www.mydomain.com/cron/WonProductNotification >/dev/null 2>&1
    Code:
    * * * * * wget -q --spider https://www.mydomain.com/cron/WonProductNotification >/dev/null 2>&1
     
  5. h0feer

    h0feer Member

    Joined:
    Nov 24, 2016
    Messages:
    15
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    serbia
    cPanel Access Level:
    Root Administrator


    Hi,


    i just tried both of these examples, none of them works , means when i change them like you said Cron is not doing it's job... any another suggestion please?
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,425
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    Are you able to execute the script instead of downloading the file? For instance, what exactly is the cron job and the file doing?

    Thank you.
     
Loading...

Share This Page