v12/10B
Greetings,
Belong to one network that FTPs datafeeds directly to the /feeds/ folder with .zip extensions (merchantname.zip) - File names are consistent within the .zip file (merchantname.txt).
We currently use the following CRON to decompress all feeds in the /feeds/ folder then import:
cd /path/to/feeds/;gzip -f -d *.gz;/usr/bin/wget --max-redirect=9999 -O /dev/null "http://www.example.com/scripts/import_slow.php?password=xxxxxxx$&filename=@ALL"
What do we add, and where, to unzip the .zip files?
Sorry for being daft (long week already).
Thanks!
Hi David,
However, unfortunately this did not work -
Any suggestions as to the possible problem?
Hi David,
Tried every which way but loose and still can't get it to work.
This is the error that appears at the top of the emailed CRON report:
Archive: MerchantNameA.zip
caution: filename not matched: MerchantNameB.zip
caution: filename not matched: MerchantNameC.zip
caution: filename not matched: MerchantNameD.zip
caution: filename not matched: MerchantNameE.zip
caution: filename not matched: MerchantNameF.zip
caution: filename not matched: MerchantNameG.zip
Thoughts?
Hi,
Just looked into this and it would appear that the wildcard should be escaped with the backslash character in the command, e.g.
unzip \*.zip
This will pass the * into the unzip program; instead of being expanded out by the OS...
Hope this helps!
Cheers,
David.
--
PriceTapestry.com
Hi David,
Thanks, again!
Question:
Any need to add -f to overwrite the existing feed?
And for giggles, what the heck is the -d flag for, LOL.
Thanks one more time!
-d is "decompress" (gzip and gunzip are actually the same program!)
Cheers,
David.
--
PriceTapestry.com
Thanks,David!
Once we started playing around with flags we were able to get it to work.
One of our tests spit out the following in the CRON report, which we found quite helpful:
{content saved}
We went with -u in the command.
Did discover, unlike gzip, that the .zip file does not delete after being extracted.
Thanks, again!
Hi,
It should just be a case of including the unzip command inline - have a go with:
cd /path/to/feeds/;unzip *.zip;gzip -f -d *.gz;/usr/bin/wget --max-redirect=9999 -O /dev/null "http://www.example.com/scripts/import_slow.php?password=xxxxxxx$&filename=@ALL"
Cheers,
David.
--
PriceTapestry.com