Code: Select all
00 * * * * /usr/local/bin/replication &> /dev/null
This arrangement has been working well for years, but since upgrading from Stretch to Buster, occasionally an error or an echo statement in the script will slip past /dev/null and wind up generating an email to root. It rarely happens, but when it does occur, it's always the first echo- or error-generating statement in the script. For instance, the replication script starts out like this:
Code: Select all
#Unmount any accidental mounts or leftover mounts
umount /media/failovervar
umount /media/failoveretc
umount /media/failoverstorage
umount /media/failoverusr/local
I never get emails about unmounting any of the other shares. Similarly, in scripts that contain echoes (for when I run them manually), I only ever see the first echo in the script, never any of the subsequent ones.umount: /media/failovervar: not mounted.
There are multiple scripts affected, but most of the time they're fine. It's just once in a random while that this happens, like say once or twice a week for scripts that run multiple times every day.
What's going on? Would it help to change from &> /dev/null to > /dev/null 2>&1?