rsync-time-backup icon indicating copy to clipboard operation
rsync-time-backup copied to clipboard

Fallback to rsync returncode when logfile is not created to detect errors

Open fthiery opened this issue 4 years ago • 0 comments

All rsync error detection is based on the contents of the logfile. If the errors are not in the file, or if the logfile is not present, the backup script assumes everything went fine (!!!).

This PR uses the returncode as additional condition to marking the backup as successful.

Apr 29 10:40:13 backup rsync_tmbackup[28480]: [generator] io timeout after 30 seconds -- exiting
Apr 29 10:40:13 backup rsync_tmbackup[28480]: rsync error: timeout in data send/receive (code 30) at io.c(204) [generator=3.1.3]
Apr 29 11:57:58 backup rsync_tmbackup[28480]: cd+++++++++ somedir
Apr 29 11:57:58 backup rsync_tmbackup[28480]: rsync: [sender] write error: Broken pipe (32)
Apr 29 11:57:58 backup rsync_tmbackup[28480]: rsync error: timeout in data send/receive (code 30) at io.c(829) [sender=3.1.3]
Apr 29 11:57:58 backup rsync_tmbackup[28480]: rsync_tmbackup: Backup completed without errors.
Apr 29 11:57:58 backup systemd[1]: backup-diskarray.service: Succeeded.

fthiery avatar Apr 29 '20 12:04 fthiery