Hello friends. I utilize a home server running OpenMediaVault. I keep everything stored there and sort things like pictures as needed. Basically what I do in this case is I put the SD card in the laptop from our camera and hit a hot key, which launches an rsync script. It syncs all pictures to a TO BE SORTED folder. Later on I'll drag/drop the items in that folder to their final destination elsewhere. Having them on the server already makes drag/drop instant, as opposed to syncing them to my laptop and drag/dropping them to different folders on the server later where I can stack up 3, 5, 10 transfers at once, which takes some time. Here is the script.
This works fine with the exception of the "Camera Sync Complete" line. The actual sync completes (as in new pictures arrive on the server), however I never get a notification that it completed.Code:#!/bin/bash set -e notify-send "Camera Sync Started" rsync -a /media/jason/SDCARD/DCIM/ jason@192.168.1.20:/media/2g780da3-263d-493f-af11-cc945e3158ef/pictures/TO_BE_SORTED/ notify-send "Camera Sync Complete"
If I remove set -e, it "works", however based on my reading, set -e is a good measure to have so if the rsync command itself fails, it does not pass the "Camera Sync Complete" command through in a false manner. Just now I unmounted the SD card and hit the hot key to run the script again, and sure enough it said Camera Sync Started followed by Camera Sync Complete... yet no SD card is mounted... so nothing truly completed.
Perhaps I should look into adding some more statements to it, so instead it'll try to sync, if it fails, it throws "Camera Sync Failed" in a notification instead. In the mean time I'm just keeping it simple and wondering if someone could explain why set -e is burning me in this case. Thanks for any assistance!
Bookmarks