Sorry in advance, I don’t know if my issue is related to Hestia Control Panel or not.
So I’m having trouble running aws s3 sync as a cron job. I did it manually via ssh client and it worked, but it failed when doing it via cron job.
Yes, the script has execute permissions, so the problem is not related to permissions.
Based on your suggestion to run without sh, it turns out the script doesn’t work, with the notification: -bash: /usr/local/backup.sh: /bin/bash^M: bad interpreter: No such file or directory
After I googled, the problem is at the “end of file” of the file. I created the file (backup.sh) using Notepad++ on Windows, with CR LF as the line ending (\r\n). But because Unix uses different line endings so it can’t read the file created on Windows.
The solution is to rewrite the script in Unix env using nano or vi (I do not try it). Or edit the file using Notepad++, using the EOL Conversion menu, change it to Unix (LF) (this is what I did).