iDrive on Linux – error logging

iDrive is an affordable backup solution with client-side encryption and dedicated Linux scripts.

Although it quite nice, the error logging policy of the cron job is less than stellar.

Cron script doesn’t write any logs

The original script redirects all messages to /dev/null. This obviously isn’t best practice.

$DAEMON 2>/dev/null 1>/dev/null &
echo $! > $PIDFILE

Fixing this is easy – just replace two lines above with following snippet (first line is optional, but may be helpful):

id | logger -t IDRIVECRON
( $DAEMON & echo $! > $PIDFILE ) 2>&1 | logger -t IDRIVECRON &

This change will redirect all messages to the system log and they can be retrieved with standard tools:

journalctl -t IDRIVECRON

Hope this helps.