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.

SOLVED How to create a cron job? Beginner

Discussion in 'General Discussion' started by googol8080, Apr 16, 2017.

Tags:
  1. googol8080

    googol8080 Active Member

    Joined:
    Sep 28, 2016
    Messages:
    38
    Likes Received:
    2
    Trophy Points:
    8
    Location:
    Philippines
    cPanel Access Level:
    Website Owner
    I want to create a cron job that can do a Session Garbage Collection, and it is recommended by php.net, here is the page from php.net (EXAMPLE #1) PHP: session_gc - Manual. I don't have a good knowledge about Linux's commands.

    Please help me, I need it, thanks.


    EDIT: In Cron Jobs - Documentation - cPanel Documentation, where do I put >/dev/null 2>&1 ? Before or after the php script?
     
    #1 googol8080, Apr 16, 2017
    Last edited: Apr 17, 2017
  2. webhostuk

    webhostuk Well-Known Member

    Joined:
    Sep 11, 2013
    Messages:
    112
    Likes Received:
    11
    Trophy Points:
    18
    cPanel Access Level:
    Website Owner
    It should be in this format:

    mycommand >/dev/null 2>&1
     
  3. googol8080

    googol8080 Active Member

    Joined:
    Sep 28, 2016
    Messages:
    38
    Likes Received:
    2
    Trophy Points:
    8
    Location:
    Philippines
    cPanel Access Level:
    Website Owner
    oh, okay, thank you!
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

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

    I'm happy to see you were able to find an answer to your question. Let us know if you have any additional questions.

    Thanks!
     
Loading...

Share This Page