1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

please help for understanding cron command

Discussion in 'Web Hosting' started by mtechprasanth, Jul 1, 2015.

  1. #1
    I need to setup cron job command, my script provider gave me this full code and tell me to modify as per cpanel. i am confused where to start to get the details for the command. please help.

    Provided command:- /usr/local/bin/php "/home/olkumfvp/public_html/wp-content/uploads/scripts/script v.1.14/cron.php" >> "/home/olkumfvp/public_html/wp-content/uploads/scripts/script v.1.14/cronlog.txt" 2>&1



    instructions given:-

    /usr/local/bin/php is the path to PHP. "/home/olkumfvp/public_html/script/cron.php" is the path to the cron.php file on server. "/home/olkumfvp/public_html/script/cronlog.txt" indicates where to save logs for cron. System will create this file if it does not exist 2>&1 Keep this as is.




    what are the steps i need to take. please help me.
     
    mtechprasanth, Jul 1, 2015 IP
  2. sarahk

    sarahk iTamer Staff

    Messages:
    28,494
    Likes Received:
    4,457
    Best Answers:
    123
    Trophy Points:
    665
    #2
    if you run a webpage the output is sent to your browser. In a cron the output is sent to a log file if you want.

    So your command has two parts
    the webpage that gets called
    the log that catches any output

    Calling the script/webpage is where you will normally have problems

    from experience webhosts usually have zero experience is setting up crons and their paths are usually wrong. So you need to set up a simple script that maybe mails you when it runs
    mail('myemail@aol.com', 'test: '.time(), 'test);
    Code (markup):
    and keep tweaking the path to the script until you get it right.
     
    sarahk, Jul 1, 2015 IP
  3. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #3
    If a cron-job fails, it shold get logged on the server, and normally, you can view that log when logged into your shell-account. Or you can ask (if it's not already doing it) if the host can email you the logs automatically.
     
    PoPSiCLe, Jul 2, 2015 IP
  4. Lanie2013

    Lanie2013 Member

    Messages:
    23
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    31
    #4
    A convenient method, you can use this useful service to create cron: https://www.easycron.com/.
     
    Lanie2013, Jul 7, 2015 IP
  5. SalvadorWilliam

    SalvadorWilliam Peon

    Messages:
    18
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #5
    Corn command is a time based operation scheduler in Unix type of operating systems. In this user set up the operations to be done automatically at a particular time period.
     
    SalvadorWilliam, Jul 24, 2015 IP
  6. Neffrit

    Neffrit Greenhorn

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    21
    #6
    http://freehosts.pp.ua/ and http://fhosts.tk cron start yes on the VestaCP
     
    Last edited: Aug 1, 2015
    Neffrit, Aug 1, 2015 IP
  7. s2pidkaspr

    s2pidkaspr Active Member

    Messages:
    148
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    53
    #7

    Simple. Just follow the command given to you.

    1) Go to your cPanel (main landing page)
    2) Scroll down until you see "Crons Jobs" and click it, though maybe it will only display as just "Crons"
    3) Click on the dropdown arrow named "Common Settings" and choose which time you want the cron command to run, usually crons are Once per Day but of course that depends of what kind of job your crons does then maybe it requires less time than that or maybe longer.
    4) After choosing a "Common Settings", down below where you see an input field named "Command", simply add the whole command given to you which is /usr/local/bin/php "/home/olkumfvp/public_html/wp-content/uploads/scripts/script v.1.14/cron.php" >> "/home/olkumfvp/public_html/wp-content/uploads/scripts/script v.1.14/cronlog.txt" 2>&1
    5. Click "Save Settings" or "Add New Cron Job"
    6. Simply Done.
     
    s2pidkaspr, Aug 17, 2015 IP