Scripts in /etc/cron.daily/ are executed by run-parts. Ensure your script filename does not contain invalid characters (e.g., dots or extensions). A valid name will be my_script, not my_script.sh.
-rw-r--r-- 1 root root 102 Mar 2 2023 .placeholder
-rwxr-xr-x 1 root root 1478 May 25 2023 apt-compat
-rwxr-xr-x 1 root root 819 Nov 25 21:57 backup.sh
-rwxr-xr-x 1 root root 2614 Oct 18 01:16 dietpi
-rwxr-xr-x 1 root root 123 Mar 27 2023 dpkg
So it seems like I should rename the backup script indeed.
Moreover here is the content of the script:
#!/bin/bash
####################################
#
# Backup to NFS mount script.
#
####################################
# What to backup.
backup_files="/mnt/083c86b5-c226-4a06-b752-c54b6acc9402/docker/mosquitto /mnt/083c86b5-c226-4a06-b752-c54b6acc9402/docker/zigbee2mqtt /mnt/083c86b5-c226-4a06-b752-c54b6acc9402/docker/homeassistant"
# Where to backup to.
dest="/mnt/083c86b5-c226-4a06-b752-c54b6acc9402/backup"
# Create archive filename.
day=$(date +%A)
hostname=$(hostname -s)
archive_file="$hostname-$day.tgz"
# Print start status message.
echo "Backing up $backup_files to $dest/$archive_file"
date
echo
# Backup the files using tar.
tar czf $dest/$archive_file $backup_files
# Print end status message.
echo
echo "Backup finished"
date
# Long listing of files in $dest to check file sizes.
ls -lh $dest