Greetings,
Within the Commission Junction affiliate interface we can specify what feeds we want downloaded to any directory in our server. Thus, eliminating the need to fetch the feed.
Question is, how can we unzip the files automatically or on a cron, so we can then run another cron to import them?
One problem that may exist is exec() is DISABLED on our servers (Safe Mode disable_functions). While we have dedicated servers we still believe a security risk exists by enabling exec(). Also, we have other software on those servers that require exec() to be disabled.
We would prefer not to have to write a php file with the name of every file we want to unzip.
Suggestions and ideas?
Thanks!
Thanks, David!
Knew it was something simple, LOL.
Will give it a go.
Thanks, again!
Hello David,
Received this response on the cron job:
"gzip: Merchant-Product_Catalog.txt already exists; not overwritten"
Oops.
Any suggestions?
Thanks!
Hi,
Ah yes - add the -f parameter to force overwrite; e.g.
cd /path/to/feeds/;gzip -f -d *.gz
Cheers,
David.
--
PriceTapestry.com
Thanks, David - Success!
Searched online yesterday but couldn't find a list of flags anywhere.
Thanks, again!
Hi,
Rather than a PHP solution; I would simply schedule a CRON process to run the unzip process immediately before your normal import CRON job, for example:
cd /path/to/feeds/;gzip -d *.gz
You could actually just chain that with your import.php CRON job of course; e.g.
cd /path/to/feeds/;/usr/bin/gzip -d *.gz;cd /path/to/scripts;/usr/bin/php import.php @ALL
Cheers,
David.
--
PriceTapestry.com