I have a simple script that backups Raspbian to a network share:
sudo dd if=/dev/mmcblk0 of="/mnt/NAS/backup.img"
When I manually run the script with
sudo ./backup.sh, everything is fine, the write speed is about 25 MiB/s and the backup is finished in under 10 minutes (8 GB SD card).
To automate the process I added the script to the root crontab file but noticed that the backup becomes super slow and would take almost 8 hours.
I switched to root with
sudo -i to check the dd output, and the write speed indeed drops to 300 KiB/s.
What could be the reason for this?