Hello
I have a problem with the crontab command
when I run a code containing Curl on the command line it runs without fail but as soon as I program it with crontab it executes everything except the curl returns fail
thank you for helping me to resolve this problem because since Monday I look without finding an issue
ps. I got this message: curl: (7) Failed connect to apirest.atinternet-solutions.com:443; Connection timed out
This is most likely because the environment for the process set up by cron is very basic. You may need to include all sorts of things such as proxy variables in your called script.
Can you share the code and details of what OS/version you are using? Sanitised output from uname -a should be fine.
Without these variables, the cron-run script will not know how to get out of your network. Why would it? These are probably in a profile for you somewhere.
You can explicitly set them in your cron-run script, or if it might be called from the command line and people may want to use their own, you could:-
This will use the value proxy.speria.saint-trop.net:3128 for http_proxy if the variable has not been set yet, i.e. this is a default but an existing setting will be retained.
Obviously do the same thing for the https_proxy variable too.
If it's working, would you care to share the completed solution (or the relevant bits) for anyone finding this script with a similar problem in future?