I’ve been getting output from cron mailed to me as:
/etc/cron.daily/mycron:
SIOCADDRT: File exists
SIOCADDRT: File exists
This warning stems from the same route being set several times. I want to make sure eth0 is set to be the default device, should it have changed for some reason.
The message breaks down to this:
SIOC = Serial Input Output Controller
ADD = action is ADD
RT = RouTe
File exists = This means that the route is already configured (file exists in /proc)
In my case the solution is to simply suppress the message by redirecting it to /dev/null:
route add default dev eth0 2>/dev/null