I'm trying to get the RAID status every time i boot into my system (Debian) and send the output as notification in the desktop.
This works as expected from terminal:
sudo mdadm --detail /dev/md0 | grep 'Working Devices :' | while read OUTPUT; do notify-send "$OUTPUT"; done
but it won't work if I run a crontab job pointing at the script :
mdadm --detail /dev/md0 | grep 'Working Devices :' | while read OUTPUT; do notify-send "$OUTPUT"; done
The script is set to be executable and is ran from crontab root as:
@reboot /PATH/scripth.sh
this also won't work:
* * * * * /PATH/scripth.sh
and logs are not produced when:
* * * * * /PATH/scripth.sh > /PATH/crontab.log