OMV doesn't email me on a completed sync.

  • Hello friends. OMV is my main server, but I have a basic Ubuntu Server running on a separate box. It turns on automatically via wakeonlan (WOL) from OMV, waits 5 minutes (in case a disk check kicks in), rsyncs my data, and remotely shuts it down. Here's what it does.



    I like this because it ensures my "backup" server is only on when necessary and not using 24 hours of daily electricity for 10-12 minutes worth of actual use.


    When this command completes, or even returns an error, I don't get an email. I'd like to get an email of the output regardless, whether successful or not. I tested this by changing the source path (/media/UUID) to something that was intentionally wrong and ran it from terminal. I saw it fail, but never got an email. Later I corrected it, ran it, saw it succeed, but never got an email.


    Is there a way to edit this so I get an email notification whether success or fail?

  • Is there a way to edit this so I get an email notification whether success or fail?


    Yes of course, but you have to compose that manually. A simple shell script does not know anything about sending an email so I am not sure why you expect that.


    You can for example let the rsync output go into a file like this:
    rsync -a /media/2f730da3-263d-473f-af11-cc955e3158ef/Documents jason@192.168.1.201:/media/backup/ >>/tmp/doclog.txt
    Then send it via mail to your account in another line in your script:
    mail -s “Document rsync log” yourname@yourmail.com < /tmp/doclog.txt
    This will copy the content of doclog.txt into the body of the mail.

    Homebox: Bitfenix Prodigy Case, ASUS E45M1-I DELUXE ITX, 8GB RAM, 5x 4TB HGST Raid-5 Data, 1x 320GB 2,5" WD Bootdrive via eSATA from the backside
    Companybox 1: Standard Midi-Tower, Intel S3420 MoBo, Xeon 3450 CPU, 16GB RAM, 5x 2TB Seagate Data, 1x 80GB Samsung Bootdrive - testing for iSCSI to ESXi-Hosts
    Companybox 2: 19" Rackservercase 4HE, Intel S975XBX2 MoBo, C2D@2200MHz, 8GB RAM, HP P212 Raidcontroller, 4x 1TB WD Raid-0 Data, 80GB Samsung Bootdrive, Intel 1000Pro DualPort (Bonded in a VLAN) - Temp-NFS-storage for ESXi-Hosts

  • Yes, cron job. I wasn't sure how omv was designed in terms of notifications. The fact it emails me the top "wakeonlan 00:11:22:33:44:55" line but nothing else made me unsure if it was trying and failing to send me the whole output or if I would need additional tweaking to complete it. I see now I forgot to mention that in the original post so hopefully that makes more sense as to why I was a little "uhh?" over that part. I'll give your suggestion a shot. Thank you!

  • Well the verbose option in rsync is off so I doubt you get too much output there.


    That's right.... to add a verbose output it is a good idea to call rsync with the parameters rsync -av.


    Ah and I just saw that I suggested to redirect the rsync output to file by using two >> characters, this will always append the output to that file. Use only one "greater than" character, because this will overwrite the file every time the script will be called and that makes more sense in this case.

    Homebox: Bitfenix Prodigy Case, ASUS E45M1-I DELUXE ITX, 8GB RAM, 5x 4TB HGST Raid-5 Data, 1x 320GB 2,5" WD Bootdrive via eSATA from the backside
    Companybox 1: Standard Midi-Tower, Intel S3420 MoBo, Xeon 3450 CPU, 16GB RAM, 5x 2TB Seagate Data, 1x 80GB Samsung Bootdrive - testing for iSCSI to ESXi-Hosts
    Companybox 2: 19" Rackservercase 4HE, Intel S975XBX2 MoBo, C2D@2200MHz, 8GB RAM, HP P212 Raidcontroller, 4x 1TB WD Raid-0 Data, 80GB Samsung Bootdrive, Intel 1000Pro DualPort (Bonded in a VLAN) - Temp-NFS-storage for ESXi-Hosts

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!