I have a bash script that runs as a cron to backup files on the server.
#!/bin/bash FILE=/path/to/backup_$(date +%Y%m%d).tar tar -cf $FILE /backup/this /and/that /and/someotherfiles gzip $FILE
When I run the script directly using:
sudo bash ./backup-files.sh
It gzips the file, but last night when the cron ran it left it as a tar. Would the cron have saved a log somewhere that'd point to why this may be the case?