Results 1 to 23 of 23
  1. #1
    Member
    Join Date
    October 6th, 2006
    Posts
    45
    Cron job
    I'm probably being a bit cheeky here, however if I don't ask I don't get.

    Would any of you clever guys out there be kind enough to give me an example on what I put in a cron job to automatically call datafeeds from progam servers for my approved programs.

    Here's hoping!

  2. #2
    Moderator MichaelColey's Avatar
    Join Date
    January 18th, 2005
    Location
    Mansfield, TX
    Posts
    16,232
    0 * * * * nice /bin/hourly-feed-processing-script
    Michael Coley
    Amazing-Bargains.com
     Affiliate Tips | Merchant Best Practices | Affiliate Friendly? | Couponing | CPA Networks? | ABW Tips | Activating Affiliates
    "Education is the most powerful weapon which you can use to change the world." Nelson Mandela

  3. #3
    Member
    Join Date
    October 6th, 2006
    Posts
    45
    Is that supposed to mean something?

  4. #4
    Affiliate Manager TFAW.com's Avatar
    Join Date
    January 18th, 2005
    Location
    Milwaukie, OR
    Posts
    165
    Hi templus,

    Assuming that you have ssh access to your server and privileges to set up cron jobs...

    - Login through ssh
    - edit the crontab using 'crontab -e'
    - enter the line specified by Mr. Coley (which will execute the script at zero minutes past every hour)
    - save and exit
    - see man page for more details, i.e. http://www.hmug.org/man/5/crontab.php

    Good luck.

    -Dale
    Dale LaFountain, CIO, <a style="color:#c23015; font-weight:bold; text-decoration:underline;" href="http://www.tfaw.com/">Things From Another World</a> - More Comics. More Toys. More Stuff. More FUN!
    14% base comm / up to 21.5% w/perf incent / 90 return days / parasite free / HUGE datafeed / <a style="color:#c23015; font-weight:bold; text-decoration:underline;" href="http://www.tfaw.com/Help/Affiliate-Information___168?qt=abw">[b]Join[/b]</a>

  5. #5
    ABW Ambassador Nature Boy's Avatar
    Join Date
    January 18th, 2005
    Location
    Tennessee
    Posts
    1,423
    If you have hosting that uses cPanel, there should be a link within cPanel to setup cron jobs. Mine has a standard and advanced (Unix Style) setting which makes it fairly simple to automate pulling datafeeds. Just fill in the blank.
    Scott
    If you can't dazzle them with brilliance, then baffle them with bulls#!t
    Don't tell me that you'll do it... SHOW ME.
    Just because everyone else is drinking it is no reason for me to drink the KOOL-AID.

  6. #6
    More Cheesier Than Ever Cheesehead's Avatar
    Join Date
    January 18th, 2005
    Location
    Land of The NFL Champs!
    Posts
    2,942
    Use the UNIX command
    curl -s -o /dev/null http://www.webpagetoupdatemysite.com

    This means you need to have a script on a web page that will update your site upon opening. You also need to set the Minute, Hour, Day, Month, Weekday for the update to occur. You may also need your server support to enable "Get" in order for this to work. Your first chore will be to get a script on a page written.
    This World is Not My Home
    We're gonna go inside, we're gonna go outside, inside and outside. . . And then we're gonna go go go and we're not gonna stop til we get across that goalline! Quotes from the movie Rudy, 1993

  7. #7
    Member
    Join Date
    October 6th, 2006
    Posts
    45
    Hi

    Thanks Guys for all your replies. Judging by the content of the replies I think I'm probably lacking in the required skills, although I can get round most things including where to go to setup the cron job, the rest of it is beyond me but thanks anyway.

    By the way my reply to Michael's post looks as though I'm being rude and ungrateful, this was not my intension. So apologise to you Michael if thats how it looked.

    Delboy

  8. #8
    Affiliate Manager TFAW.com's Avatar
    Join Date
    January 18th, 2005
    Location
    Milwaukie, OR
    Posts
    165
    For some reason the link I posted above no longer works, so here's another two for help with cron:

    http://www.tech-geeks.org/contrib/md...ntab-howto.htm

    http://www.webmasters-central.com/t/cron.shtml

    Or, you can search Google for "crontab howto" like I did...

    -Dale
    Dale LaFountain, CIO, <a style="color:#c23015; font-weight:bold; text-decoration:underline;" href="http://www.tfaw.com/">Things From Another World</a> - More Comics. More Toys. More Stuff. More FUN!
    14% base comm / up to 21.5% w/perf incent / 90 return days / parasite free / HUGE datafeed / <a style="color:#c23015; font-weight:bold; text-decoration:underline;" href="http://www.tfaw.com/Help/Affiliate-Information___168?qt=abw">[b]Join[/b]</a>

  9. #9
    Member
    Join Date
    October 6th, 2006
    Posts
    45
    Thanks Dale

    I'm grateful for your assistance.

    Delboy

  10. #10
    ABW Ambassador Snib's Avatar
    Join Date
    January 18th, 2005
    Location
    Virginia
    Posts
    5,303
    I usually open my crontab directly from /var/spool/cron/my_login with vim. After I save the file my crontab is automatically updated. I'll usually do crontab -l just to double check it.

    - Scott
    Hatred stirs up strife, But love covers all transgressions.

  11. #11
    Moderator MichaelColey's Avatar
    Join Date
    January 18th, 2005
    Location
    Mansfield, TX
    Posts
    16,232
    You can edit the crontab by typing "crontab -e".
    Michael Coley
    Amazing-Bargains.com
     Affiliate Tips | Merchant Best Practices | Affiliate Friendly? | Couponing | CPA Networks? | ABW Tips | Activating Affiliates
    "Education is the most powerful weapon which you can use to change the world." Nelson Mandela

  12. #12
    ABW Ambassador PatrickAllmond's Avatar
    Join Date
    September 20th, 2005
    Location
    OKC
    Posts
    1,219
    I highly recommend what somebody said earlier. Unless you are a command line wizard like Snib use something like the Cpanel pretty frontend if you have it.

    Also... what do you mean by 'call datafeeds' (I am surprised nobody caught that). Cron has nothing to do with datafeeds. What you must have first is some kind of shell, php, or other script to do the work that you want. You then use CRON to schedule that script to run on a regular basis (minutely, hourly, Every 3rd Sunday that falls on the weekend, etc.)

    Patrick
    ---
    This response was masterly crafted via the fingers of Patrick Allmond who believe you should StopDoingNothing starting today.
    ---
    Focus Consulting is where I roll | Follow @patrickallmond on Twitter
    Search Engine Marketing | Search Engine Optimization | Social Media | Online Video

  13. #13
    Member
    Join Date
    October 6th, 2006
    Posts
    45
    Hi Patrick

    I'll try and explain what I need instead of trying to use my own terminology.

    I would like to set "something" to load datafeeds from SAS ftp programs automatically onto my sites instead of updating manually.

    If that makes sense.

    Thanks for your post.

    Delboy

  14. #14
    ABW Ambassador Nature Boy's Avatar
    Join Date
    January 18th, 2005
    Location
    Tennessee
    Posts
    1,423
    Quote Originally Posted by templus
    I would like to set "something" to load datafeeds from SAS ftp programs automatically onto my sites instead of updating manually.
    Here's a good place to start:
    http://forum.abestweb.com/showthread.php?t=86606
    Scott
    If you can't dazzle them with brilliance, then baffle them with bulls#!t
    Don't tell me that you'll do it... SHOW ME.
    Just because everyone else is drinking it is no reason for me to drink the KOOL-AID.

  15. #15
    ABW Ambassador Snib's Avatar
    Join Date
    January 18th, 2005
    Location
    Virginia
    Posts
    5,303
    Quote Originally Posted by MichaelColey
    You can edit the crontab by typing "crontab -e".
    If you're familiar with that text editor. Personally I can't use anything but vim from the command line.

    - Scott
    Hatred stirs up strife, But love covers all transgressions.

  16. #16
    ABW Ambassador PatrickAllmond's Avatar
    Join Date
    September 20th, 2005
    Location
    OKC
    Posts
    1,219
    NAture Boy is correct - read that thread and figure out how to write a PHP script that will do what you need. Once you have that done and you can run it manually and it does what you need, THEN worry about cron. Until then I'd keep cron out of the picture.
    ---
    This response was masterly crafted via the fingers of Patrick Allmond who believe you should StopDoingNothing starting today.
    ---
    Focus Consulting is where I roll | Follow @patrickallmond on Twitter
    Search Engine Marketing | Search Engine Optimization | Social Media | Online Video

  17. #17
    Life is Supposed to be Fun! Rexanne's Avatar
    Join Date
    January 18th, 2005
    Location
    Los Angeles
    Posts
    12,360
    Is it just me or does "Cron job" sounds kinky to anyone else?
    Peace,

    Rexanne

    Rexanne.com
    Loving Everyone's Child Creates Magic


  18. #18
    Resident Genius and Staunch Capitalist Leader's Avatar
    Join Date
    January 18th, 2005
    Location
    Florida
    Posts
    12,817
    Quote Originally Posted by Rexanne
    Is it just me or does "Cron job" sounds kinky to anyone else?
    Well, it didn't...

    But now I've got the image of some 90-yr-olds who're...
    *tries to wash mental picture away*

  19. #19
    More Cheesier Than Ever Cheesehead's Avatar
    Join Date
    January 18th, 2005
    Location
    Land of The NFL Champs!
    Posts
    2,942
    Here's the downfall of Crontabs. If your ftp folder mysteriously disappears as it did for me and many others lately, then an update may very well wipe out your mysql table (as it did for me).

    So I am going to have to disable all my crontabs set for this weekend since we will be out of town. Otherwise, I will have to set up alternate scripts that use an old feed that I can run from any browser if needed. I would need about 24 such scripts.
    This World is Not My Home
    We're gonna go inside, we're gonna go outside, inside and outside. . . And then we're gonna go go go and we're not gonna stop til we get across that goalline! Quotes from the movie Rudy, 1993

  20. #20
    Moderator MichaelColey's Avatar
    Join Date
    January 18th, 2005
    Location
    Mansfield, TX
    Posts
    16,232
    It's always a good practice to have your datafeed update routines properly handle exceptions. If the file is missing or empty (or a significant percent smaller than normal), it's usually best not to process it but to notify you of the exception instead.
    Michael Coley
    Amazing-Bargains.com
     Affiliate Tips | Merchant Best Practices | Affiliate Friendly? | Couponing | CPA Networks? | ABW Tips | Activating Affiliates
    "Education is the most powerful weapon which you can use to change the world." Nelson Mandela

  21. #21
    More Cheesier Than Ever Cheesehead's Avatar
    Join Date
    January 18th, 2005
    Location
    Land of The NFL Champs!
    Posts
    2,942
    Quote Originally Posted by MichaelColey
    It's always a good practice to have your datafeed update routines properly handle exceptions. If the file is missing or empty (or a significant percent smaller than normal), it's usually best not to process it but to notify you of the exception instead.
    Is there a way to do this within a script used to create a mysql table?
    This World is Not My Home
    We're gonna go inside, we're gonna go outside, inside and outside. . . And then we're gonna go go go and we're not gonna stop til we get across that goalline! Quotes from the movie Rudy, 1993

  22. #22
    ABW Ambassador Snib's Avatar
    Join Date
    January 18th, 2005
    Location
    Virginia
    Posts
    5,303
    Quote Originally Posted by Cheesehead
    Here's the downfall of Crontabs. If your ftp folder mysteriously disappears as it did for me and many others lately, then an update may very well wipe out your mysql table (as it did for me).
    Does your import script delete all the products before importing? If so, you might want to keep them there and only flag the out of stock products so they don't show up on your site. Deleting is no good because you lose your unique product ID's and any associations you made with the product between a review, comment, price match, category, etc. I outlined how to flag out of stock products in the Bulletproof Datafeed thread.

    - Scott
    Hatred stirs up strife, But love covers all transgressions.

  23. #23
    Moderator MichaelColey's Avatar
    Join Date
    January 18th, 2005
    Location
    Mansfield, TX
    Posts
    16,232
    Quote Originally Posted by Cheesehead
    Is there a way to do this within a script used to create a mysql table?
    It would depend on what you're using to script your updates. I know that I'm able to do it fairly easily with Perl. I would assume that virtually any programming environment would provide enough flexibility to do it.

    I do something similar to what Snib is recommending. I flag the existing products as "pending delete", then as I verify/update each record I change it to "updated". After I'm done, I see what percent of records are "pending delete". If it's too high, I leave them undeleted. If a reasonable percentage are pending deletion, I flag them as "deleted". My scripts that display datafeed items will only select "updated" and "pending delete" items, not "deleted" ones.
    Michael Coley
    Amazing-Bargains.com
     Affiliate Tips | Merchant Best Practices | Affiliate Friendly? | Couponing | CPA Networks? | ABW Tips | Activating Affiliates
    "Education is the most powerful weapon which you can use to change the world." Nelson Mandela

  24. Newsletter Signup

+ Reply to Thread

Similar Threads

  1. Help setting my cron job!
    By Ricardo Dacosta in forum Programming / Datafeeds / Tools
    Replies: 1
    Last Post: June 19th, 2008, 09:35 AM
  2. Hostgator Cron Job
    By Code Monkey in forum Midnight Cafe'
    Replies: 3
    Last Post: June 2nd, 2008, 08:30 PM
  3. Deleted Cron Job
    By bettylou in forum Programming / Datafeeds / Tools
    Replies: 8
    Last Post: March 27th, 2008, 12:55 AM
  4. Cron Job Question
    By Doug247 in forum Programming / Datafeeds / Tools
    Replies: 9
    Last Post: March 18th, 2008, 01:13 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •