I have a simple script on my home server to sync data to my backup drive to be stored.
Right now it runs multiple rsyncs one after another.
Sometimes rsync fails on one or two of them. When this happens, I want it to email me saying it failed, I already have it email me a report, but, I want a way to know if it fails.
If Rsync exits with a non 0 code it means failure. So I would need a simple bit of code to check the rsync status and if it's not 0, allow me to execute an action.
Does anyone have any tips on how i would accomplish this? Thank you.