1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Cron job for wp-o-matic, who knows their shit?

Discussion in 'Blogging' started by loclhero, Feb 27, 2009.

  1. loclhero

    loclhero Supreme Member

    Joined:
    Jun 11, 2007
    Messages:
    1,453
    Likes Received:
    2,414
    Gender:
    Male
    Location:
    Copperhead Road
    I'm not a coder but I'm not a noob either but for the life of me I can't get a cron job for WP-O-Matic saved in my cpanel. What do I need to change here?

    Code that wp-o-matic tells me to save:
    */20 * * * * <em>{wget or similar command here}</em> hxxp://www.mywebsite.com/wp-content/plugins/wp-o-matic/cron.php?code=48f3e35f

    I save it as is and set the job to run at the time interval I want. It doesn't run and when I go back to check for running cron jobs there's nothing there.

    I tried removing everything from <em> to </em>, tried leaving wget...wtf?
    What do I need to change and why can't I see the running job?
     
  2. wowhaxor

    wowhaxor Executive VIP Premium Member

    Joined:
    Apr 28, 2007
    Messages:
    2,021
    Likes Received:
    3,361
    Location:
    ?¿?
    Home Page:
    I'd also be interested in knowing this, I only spent a couple of minutes on mine (a while back) but never got the cron to work so I did it the other way.
     
  3. blackhaze

    blackhaze Power Member

    Joined:
    Jan 11, 2008
    Messages:
    661
    Likes Received:
    167
    Occupation:
    self made millionaire
    Location:
    in the matrix
    Home Page:
    remove all the EM stuff!

    */20 * * * * <em>{wget or similar command here}</em> hxxp://www.mywebsite.com/wp-content/plugins/wp-o-matic/cron.php?code=48f3e35f

    This means, every 20 mins, and the other four * just leave as "*"

    command would be simply WGET /somepath/herehxxp://someurl.com/cron.php?code=666

    or whatever the command is.


    like
    * * * * * /usr/bin/php /home/.sites/28/site1/web/folder/cron.php >/dev/null 2>&1
     
  4. STBNetwork

    STBNetwork Junior Member

    Joined:
    Feb 3, 2009
    Messages:
    145
    Likes Received:
    50
  5. AWG123

    AWG123 Newbie

    Joined:
    Apr 22, 2008
    Messages:
    40
    Likes Received:
    14
    I have different hosts and sometimes the cron command has to modified. Your host company should be able to fix this for you. It could be how your server is configured.
     
  6. blackhaze

    blackhaze Power Member

    Joined:
    Jan 11, 2008
    Messages:
    661
    Likes Received:
    167
    Occupation:
    self made millionaire
    Location:
    in the matrix
    Home Page:
    uh....thats what's called server overload :) Say, you get 100 visitors/hour....and every time the page is loaded its checking?

    By the way i switched to "yaab" autoblogger since i had problems with any other autoblogger, and yaab has a built-in cron.
     
  7. iggypop

    iggypop Junior Member

    Joined:
    Feb 25, 2009
    Messages:
    171
    Likes Received:
    52
    i use putty to get ssh access to the shell, log into the editor (vi on my system - yours may be different), and edit the cron jobs there. it's a pain to do, but once it's set, it's set

    pm me if you need specific help setting this up. i'd be glad to share my knowledge
     
  8. STBNetwork

    STBNetwork Junior Member

    Joined:
    Feb 3, 2009
    Messages:
    145
    Likes Received:
    50
    i get between 80-100 visitors an hour and i cant tell a difference on my server speed.
     
  9. loclhero

    loclhero Supreme Member

    Joined:
    Jun 11, 2007
    Messages:
    1,453
    Likes Received:
    2,414
    Gender:
    Male
    Location:
    Copperhead Road
    That's what I thought but it still didn't work
    ??
    cpanel has their own setup where you have to enter the frequency of the cron. does the */20**** cause problems with that? if cpanel forces me to chose a frequency, should i just delete everything before hxxp://www.mywebsite.com......etc?
     
  10. foxler

    foxler Regular Member

    Joined:
    Mar 7, 2008
    Messages:
    279
    Likes Received:
    159
    If the file you want to run is inside the server your running cron's on, I would suggest running the script straight thru php instead of relying on wget.

    for the command I currently am using at hostgator:
    /usr/bin/php /home/sponsore/public_html/development/run.php >/dev/null 2>&1

    What intervals do you want to do it? every 20 min, ever hour? My cpanel has a simple drop down menu and I could then go to advanced it tells you what to put, Ill just copy and paste it.

    Right now for every 20 min, this is what it says:
    20|*|*|*|*|/usr/bin/php /home/sponsore/public_html/development/run.php >/dev/null 2>&1

    (the "|" separate the diff form boxed)
    (the ">/dev/null 2>&1" is so an email isnt sent when the cron updates, remove if you want email)
     
  11. blackhaze

    blackhaze Power Member

    Joined:
    Jan 11, 2008
    Messages:
    661
    Likes Received:
    167
    Occupation:
    self made millionaire
    Location:
    in the matrix
    Home Page:
    */20 * * * *

    This is equal to the 5 fields in Cpanel, and the first */20" means "every 20 mins" and you can add it like it is, "*/20" and the other fields just *.

    And in the CMD field just enter the CMD, but strip all the EM tags, i dont even know where they come from.
     
  12. loclhero

    loclhero Supreme Member

    Joined:
    Jun 11, 2007
    Messages:
    1,453
    Likes Received:
    2,414
    Gender:
    Male
    Location:
    Copperhead Road
    Okay, here's what wp-o-matic gives me as a command line to use:

    [​IMG]

    Here are my two options in cpanel to use it:

    [​IMG]

    [​IMG]

    I figured in unix I enter the command and then the frequency using *30 for every 30 minutes etc, etc.

    Or in the noob style I enter the command and then use the drop downs.

    Clearly it's the command that I'm doing something wrong with and it's not getting saved.
     
  13. AnthonyC

    AnthonyC Newbie

    Joined:
    Mar 5, 2009
    Messages:
    9
    Likes Received:
    0
    for those not using cpanel use the following command
    php -q /var/www/vhosts/mydomain.com/httpdocs/wp-content/plugins/wp-o-matic/cron.php

    some servers require the php -q command in the front
     
  14. iglow

    iglow Elite Member

    Joined:
    Feb 20, 2009
    Messages:
    2,080
    Likes Received:
    859
    Home Page:
    I got cpanel and i also have same problem with <em> </em> thinge. what to put there?