Jump to content

Cronjob stripping url


oracle765

Recommended Posts

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

Link to post
Share on other sites

I have a cron job (attached)

Uh huh.

 

which runs a .sh script (attached)

Uh huh.

 

I have also attached the results from the cronjob

Uh huh.

 

any ideas whats going wrong

Not a clue.
Link to post
Share on other sites

$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.

Link to post
Share on other sites

@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
Link to post
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.