Rclone script problem when run as a cron job

I changed:

First line to be this so I can see the output in the log:

#!/usr/bin/bash -x

The -x turns on debug. You could turn that off now if you wanted by removing the -x.

I fully pathed the sqldump:

/usr/bin/mysqldump --quick --single-transaction --all-databases > "${sql_dump_file}"

The tar command is what was failing in cron as it doesn’t know paths in cron so I added a “/” before www and /root.

tar --exclude='.gnupg' -czf "${archive_file}" /var/www /root "${sql_dump_file}"

That was it.

i moved the script now to another server (where it works normally), but showing a different error when run as cron (in the output cron log)

This is the error:
/bin/sh: /rclone.sh: Permission denied

What kind of permission would this be now?

You need to make it executable:

chmod u+x /rclone.sh

yes that fixed the error.
i have another issue now.

on another server, I am backing up a folder under /usr/local/ directory with this script, and here the script fails (in cron and normal execution both).

but for another directory, cron is working.

what can be the issue here? i have lot of free disk space.