I have some PHP I need to run using a Cron job however it requires a query string parameter which contains % characters for spaces and a / after URL encoding.
Eg. http://www.example.com/folder/do_something.php?param=Foo%20%2F%20Bar
This works perfectly when I manually run in the browser but not via Cron.
My command looks like this:
curl -u username:password -O "http://www.example.com/folder/do_something.php?param=Foo%20%2F%20Bar"
My cron jobs on this server without % are working and those with % are failing and the error message is:
Cron curl -u username:password -O http://www.example.com/folder/do_something.php?param=Foo (note how it cut the URL at the first % character).
/bin/sh: -c: line 0: unexpected EOF while looking for matching `"' /bin/sh: -c: line 1: syntax error: unexpected end of file
Basically it's not looking at the whole URL. It just stops at the first % character.
I have taken this up with the webhost however they are useless and have been unable to help.
I have also tried other commands such as wget -q -O - etc. and the same problem is happening for URLs with % regardless of the command approach.
Any ideas other than removing the % characters?