I have bash script in which via gio mount a webdav share is mounted. The script works perfectly. However, when I call the script via chronjob I get errors. As I have read on the internet, it is because the cronjob not all environment variants are available.
As described on Lorenzo's page, various variables must be set.
https://lbolla.info/gio-in-cronjob.html
It is not clear to me how and where I have to insert the example of Lorenzo. I am using Debian. In the example of Lorenzo is something from Ubuntu, this I must certainly adapt.
It is an old thread, but I see there is now answer. You can't use environmental variables from Ubuntu on Debian. Going after Lorenzo's solution for Ubuntu, you should check those vars on your OS, so simply just do on your command line:
And then, simply put those vars at the beginning of your script ie. just under your bash interpreter declaration.
edit: You can also place env vars in the crontab itself, before cron definitions.