Web Hosting Forum | Lunarpages
News: July 14, 2008 - New Contest! - Submit Your WordPress Theme Designs, Win BIG!
June 30, 2008 - Submit Your Site for the July 08 Site of the Month Award!
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
July 25, 2008, 05:26:55 PM


Login with username, password and session length


Pages: [1]   Go Down
  Print  
Author Topic: Cron Job Command Help  (Read 540 times)
swiker
Space Explorer
***
Offline Offline

Posts: 6


« on: April 27, 2008, 08:44:52 PM »

Hello,
I would like to run the following command in a Cron Job:

http://www.values-galore.com/googlefroogle.php?feed=yes&upload=yes&type=products

This is for my store's Google Base feed in my Zen Cart installation. I have the feed working properly so there's no problem there. I can manually run this scrip from within my administration area on my store. However, it's been suggested to setup a Cron Job so I can have all my updates to my store products updated at Google Base for me. The above command I can actually run from an internet browser and it works perfect. However, I am unfamiliar with Cron Jobs and I can't seem to get the command right. I tried using GET, wget, curl -s, PHP but none worked. The GET & curl -s commands do work but not correctly. They actually produces weird results. What is suppose to happen is a file on the server is remade every time the command is run. It is saved as vg_google_products.xml on the server. It is then uploaded to uploads.google.com with my username and password. Well the weird results the GET & curl -s does is save the file as vg_google_.xml, saves the file with permissions of 777, only includes my store name and store website (no products) then fails to upload it.

So, something in the Cron Job command has to tell the file to run properly. Can anyone assist?
Logged
swiker
Space Explorer
***
Offline Offline

Posts: 6


« Reply #1 on: April 27, 2008, 09:19:21 PM »

I just tried this and it seemed to work.

GET 'http://www.values-galore.com/googlefroogle.php?feed=yes&upload=yes&type=products' > /dev/null 2>&1

If it's not a good command and I shouldn't use it, please let me know. If there is something better, please let me know.

Thank you,
Steve
Logged
MrPhil
Quantum Encyclopedia Writer
*****
Offline Offline

Posts: 3106



« Reply #2 on: May 04, 2008, 06:37:59 AM »

If GET works for you, you'll probably have to use that. Remember that cron jobs are Linux command line instructions -- the Web server (Apache) is nowhere in sight, so http://... will not work directly as a command.
Logged

swiker
Space Explorer
***
Offline Offline

Posts: 6


« Reply #3 on: May 04, 2008, 09:49:22 AM »

Thank you for that bit of information. Since I have zero clue about Linux I will have to look this up. However, what would you suggest for the command line I should be using?
Logged
MrPhil
Quantum Encyclopedia Writer
*****
Offline Offline

Posts: 3106



« Reply #4 on: May 04, 2008, 11:49:39 AM »

If you're trying to run a PHP file on your own site, you would use a command

php -q /home/ACCOUNTNAME/public_html/...dirs.../filename.php parm1 parm2 parm3...

Note that your code needs to process $argc and $argv list of parameters, as I don't think the URL Query String (?feed=yes&... to processing by $_REQUEST) is available. Add >/dev/null to suppress emailed output, and 2>&1 to also suppress error messages.

If you're running a PHP file on another site, I haven't tried it, but GET sounds like it works for you. Maybe someone else has a suggestion for a better method.
Logged

swiker
Space Explorer
***
Offline Offline

Posts: 6


« Reply #5 on: May 04, 2008, 12:07:49 PM »

WOW this stuff is complicated for a simply mind like mine. I have saved this information and I will work on it.

Thank you,
Steve
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.3 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks


Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM