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!

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:
    136
    Likes Received:
    11
    Trophy Points:
    18
    Location:
    UK
    cPanel Access Level:
    Website Owner
    Twitter:
    It should be in this format:

    mycommand >/dev/null 2>&1
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  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:
    44,378
    Likes Received:
    1,857
    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!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice