You are here:  » Unzipping CJ datafeeds

Support Forum



Unzipping CJ datafeeds

Submitted by Convergence on Mon, 2012-05-07 01:57 in

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!

Submitted by support on Mon, 2012-05-07 10:25

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

Submitted by Convergence on Mon, 2012-05-07 11:35

Thanks, David!

Knew it was something simple, LOL.

Will give it a go.

Thanks, again!

Submitted by Convergence on Mon, 2012-05-07 12:24

Hello David,

Received this response on the cron job:

"gzip: Merchant-Product_Catalog.txt already exists; not overwritten"

Oops.

Any suggestions?

Thanks!

Submitted by support on Tue, 2012-05-08 09:56

Hi,

Ah yes - add the -f parameter to force overwrite; e.g.

cd /path/to/feeds/;gzip -f -d *.gz

Cheers,
David.
--
PriceTapestry.com

Submitted by Convergence on Tue, 2012-05-08 15:20

Thanks, David - Success!

Searched online yesterday but couldn't find a list of flags anywhere.

Thanks, again!