Results 1 to 9 of 9
  1. #1
    ABW Ambassador bettylou's Avatar
    Join Date
    December 27th, 2005
    Location
    Indiana
    Posts
    595
    Deleted Cron Job
    I started using cron jobs last summer to automatically update the database for one of the sites that I have.

    One of the merchants on that site is VERY past due in paying my commissions, so I took their products off and deleted the cron job for their update. I noticed a few days after I did that, that they were showing on my site again. I double checked that I had deleted the cron job and this time deleted the actual file from the directory it was in. Still, the feed was getting updated.

    Since the merchant has to be in my "merchants" table in my database for their update to be done, I deleted them from that table. This seems to have fixed the issue. But I am curious why deleting the cron job and file weren't enough.

    Is the data cached somewhere on the host's server? Isn't a fresh copy pulled daily? Or how ever often the cron job is to be done?

    Thanks

    Bettylou

  2. #2
    ABW Ambassador writerguy's Avatar
    Join Date
    January 17th, 2005
    Location
    Springfield, Missouri, USA
    Posts
    3,248
    Seems to be a clear case of a demon possessed web server, to me.

    LOL!

    No, seriously, that would be way beyond my expertise. But I am really interested in what wiser minds say to explain this. Absolutely bizarre, to me.
    Generate more fake news.

  3. #3
    ABW Ambassador PatrickAllmond's Avatar
    Join Date
    September 20th, 2005
    Location
    OKC
    Posts
    1,219
    1. It is possible that your control panel did not actually do the work in the cron file. The cron jobs are in a file on the server and the control panels we use are just a front end to those.

    Here is a better, albeit more involved solution for the future. Give yourself the ability to enable/disable merchants without losing their products or stopping your cron job.

    1. Add a new table that has a list of merchants. Put in the following columns.

    Merchatid (int)
    merchantname (varchar)
    active (bit)

    2. Add all your merchants in there. For the merchantid you can make it a simple auto incrementing integer

    3. Go to your product table and add a merchant id. Make sure the merchant id s match up with what is in your merchant table.

    4. Update all your queries that get your products to only get products from active merchants:

    Example: Select column1, column2 from products join merchants on products.merchantid = merchants.merchantid where merchants.active = 1

    Now... when you want to disable a merchant you just change their active column from 1 to 0. When then pay up - change it back. Your cron job can keep on trucking so you don't miss out on any yummy data updates.

    This handy tip brought to you but the letters A and B, and the number 4.
    ---
    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

  4. #4
    ABW Ambassador bettylou's Avatar
    Join Date
    December 27th, 2005
    Location
    Indiana
    Posts
    595
    Quote Originally Posted by patrick24601
    1. It is possible that your control panel did not actually do the work in the cron file. The cron jobs are in a file on the server and the control panels we use are just a front end to those.

    Here is a better, albeit more involved solution for the future. Give yourself the ability to enable/disable merchants without losing their products or stopping your cron job.

    1. Add a new table that has a list of merchants. Put in the following columns.

    Merchatid (int)
    merchantname (varchar)
    active (bit)

    2. Add all your merchants in there. For the merchantid you can make it a simple auto incrementing integer

    3. Go to your product table and add a merchant id. Make sure the merchant id s match up with what is in your merchant table.

    4. Update all your queries that get your products to only get products from active merchants:

    Example: Select column1, column2 from products join merchants on products.merchantid = merchants.merchantid where merchants.active = 1

    Now... when you want to disable a merchant you just change their active column from 1 to 0. When then pay up - change it back. Your cron job can keep on trucking so you don't miss out on any yummy data updates.

    This handy tip brought to you but the letters A and B, and the number 4.
    This is how I do other types of tables such as those for most popular or featured products. I never thought about doing the merchants table that way. Great idea! Thanks to the letters A and B, and also to the number 4.


    Seems to be a clear case of a demon possessed web server, to me.
    I was inclined to think you were right. It was really kind of weird that the merchant just kept reappearing!

  5. #5
    ABW Ambassador bettylou's Avatar
    Join Date
    December 27th, 2005
    Location
    Indiana
    Posts
    595
    Quote Originally Posted by patrick24601
    1. It is possible that your control panel did not actually do the work in the cron file. The cron jobs are in a file on the server and the control panels we use are just a front end to those.
    So is this something that I would have to contact the web host to have them remove?

  6. #6
    ABW Ambassador PatrickAllmond's Avatar
    Join Date
    September 20th, 2005
    Location
    OKC
    Posts
    1,219
    My pleasure. I almost never create any table w/o an 'active' or 'status' column for just the reason you mentioned. You may not need it for 10 years. But you will be a happy camper when you do.
    ---
    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

  7. #7
    ABW Ambassador PatrickAllmond's Avatar
    Join Date
    September 20th, 2005
    Location
    OKC
    Posts
    1,219
    Might get them involved to see why it is happening. They should be able to determine why it is running.
    ---
    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

  8. #8
    I like traffic lights
    Join Date
    January 18th, 2005
    Location
    Southern hemisphere - away from Fukushima
    Posts
    2,936
    Usually you can't just edit a cron file, you have to edit it via a special utility known as crontab - that updates the system afterwards so the system knows the cron file has changed.

  9. #9
    ABW Ambassador Snib's Avatar
    Join Date
    January 18th, 2005
    Location
    Virginia
    Posts
    5,303
    If you have ssh access you should be able to type "crontab -l" from the command line to see what you've got going. I usually edit my cron files directly in /var/spool/cron and changes go into effect immediately.

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

  10. Newsletter Signup

+ Reply to Thread

Similar Threads

  1. cron job unzipping protocol
    By Ron Bechdolt in forum Programming / Datafeeds / Tools
    Replies: 3
    Last Post: February 10th, 2010, 11:41 AM
  2. Help setting my cron job!
    By Ricardo Dacosta in forum Programming / Datafeeds / Tools
    Replies: 1
    Last Post: June 19th, 2008, 09:35 AM
  3. Hostgator Cron Job
    By Code Monkey in forum Midnight Cafe'
    Replies: 3
    Last Post: June 2nd, 2008, 08:30 PM
  4. Cron Job Question
    By Doug247 in forum Programming / Datafeeds / Tools
    Replies: 9
    Last Post: March 18th, 2008, 01:13 PM
  5. Cron job
    By templus in forum ShareASale - SAS
    Replies: 22
    Last Post: July 29th, 2007, 03:50 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
  •