🔍 See Original Answer on Ask Ubuntu 🔗
Output redirection to a file, used inside script, is not working when executed from crontab
November 12, 2019
November 24, 2022
Copy to clipboard: false
logs/testpad1.log will behave differently depending on your current directory. It can also behave differently depending if
cron is running as root or you are calling the script from your terminal.
The safe (and usually error correcting) thing to do is hard code the full path into the file name: