oracle765 Posted January 8, 2014 Share Posted January 8, 2014 HI Professionals I have a cron job (attached) which runs a .sh script (attached) to download a csv file from an affiliate. Problem is in the URL part it comes across the $ sign within the url and cuts part of the url away so I only receive a blank empty file. I have also attached the results from the cronjob any ideas whats going wrong as when I paste the url into the browser there is obviously nothing there because it has been chopped Quote Link to comment https://forums.phpfreaks.com/topic/285190-cronjob-stripping-url/ Share on other sites More sharing options...
requinix Posted January 8, 2014 Share Posted January 8, 2014 I have a cron job (attached)Uh huh. which runs a .sh script (attached)Uh huh. I have also attached the results from the cronjobUh huh. any ideas whats going wrongNot a clue. Quote Link to comment https://forums.phpfreaks.com/topic/285190-cronjob-stripping-url/#findComment-1464378 Share on other sites More sharing options...
oracle765 Posted January 8, 2014 Author Share Posted January 8, 2014 ah didn't attach it as an sh file I have changed it to text Quote Link to comment https://forums.phpfreaks.com/topic/285190-cronjob-stripping-url/#findComment-1464383 Share on other sites More sharing options...
oracle765 Posted January 8, 2014 Author Share Posted January 8, 2014 ah sorry forgetting to click attach this file at the bottom feedimport.txt Quote Link to comment https://forums.phpfreaks.com/topic/285190-cronjob-stripping-url/#findComment-1464384 Share on other sites More sharing options...
kicken Posted January 8, 2014 Share Posted January 8, 2014 $blah is treated as a variable and the shell replaces it with that variables value (or the empty string if undefined). You need to prevent the shell from seeing it as a variable, the easiest way to do so in your case is to simply quote the URL using single-quotes rather than double-quotes. Quote Link to comment https://forums.phpfreaks.com/topic/285190-cronjob-stripping-url/#findComment-1464465 Share on other sites More sharing options...
oracle765 Posted January 9, 2014 Author Share Posted January 9, 2014 Hi Kicken that's brilliant that works thanks very much, however I am now faced with another problem. Because the files are in .GZ format I cant seem to unzip them I get an error message as shown in the new attached file saying gzip: invalid suffix '' feedimport.txt Quote Link to comment https://forums.phpfreaks.com/topic/285190-cronjob-stripping-url/#findComment-1464508 Share on other sites More sharing options...
jazzman1 Posted January 9, 2014 Share Posted January 9, 2014 Try "tar", tar -zxvf path_to_the_file Quote Link to comment https://forums.phpfreaks.com/topic/285190-cronjob-stripping-url/#findComment-1464530 Share on other sites More sharing options...
jazzman1 Posted January 9, 2014 Share Posted January 9, 2014 (edited) @oracle765, type into terminal - man gzip and look at examples. I looked at the log of your last attached file and saw this line, which is apparently wrong. /usr/bin/gzip -c -d -S "" /home/oracle765/public_html/feed/crazysales.csv.gz > /home/oracle765/public_html/feed/crazysales.csv If you want to unzip the file named "crazysales.csv.gz" and redirect the output to new one named crazysales.csv, try next: /usr/bin/gzip -c -d /home/oracle765/public_html/feed/crazysales.csv.gz > /home/oracle765/public_html/feed/crazysales.csv Edited January 9, 2014 by jazzman1 Quote Link to comment https://forums.phpfreaks.com/topic/285190-cronjob-stripping-url/#findComment-1464633 Share on other sites More sharing options...
Solution oracle765 Posted January 9, 2014 Author Solution Share Posted January 9, 2014 that worked thanks very much Quote Link to comment https://forums.phpfreaks.com/topic/285190-cronjob-stripping-url/#findComment-1464649 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.