diff options
author | Kjetil Orbekk <kjetil.orbekk@gmail.com> | 2015-11-25 22:48:29 -0500 |
---|---|---|
committer | Kjetil Orbekk <kjetil.orbekk@gmail.com> | 2015-11-25 22:48:29 -0500 |
commit | 8fd075c7124a74e46341cad1c2d1b24f0937af4c (patch) | |
tree | 676670db0beaddfd90b20f7b60af61123c8d9bcc | |
parent | ca5ca73ea92311a14223fa691a552c49fedd968f (diff) |
Simplify photos check.
-rwxr-xr-x | import/photobox_import2.sh | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/import/photobox_import2.sh b/import/photobox_import2.sh index c559a14..8108bcc 100755 --- a/import/photobox_import2.sh +++ b/import/photobox_import2.sh @@ -23,20 +23,17 @@ readonly pending_path="$(make_unique $pending_root/$(date +%Y-%m-%d))" ( flock -x -w 120 200 || exit 1 - if [[ $input != *Kingston* && $input != *EOS* ]]; then - echo "Not on the SD card reader: $input" - exit 1 - fi - if [[ -z $(find "$input" -type f -print -quit | head) ]]; then - echo "No files found. Exiting." - umount $input - exit 0 + if [[ ! -d "$backup_path/DCIM" && \ + -z $(find "$backup_path/DCIM" -iregex "$photoregex" -print -quit | head) ]]; then + echo "No photos found on $input" + exit 0 fi mkdir -p "$backup_path" rsync -Hvax "$input/." "$backup_path/." echo "Contents backed up to: $backup_path" + # TODO: Remove this check after confirming that the above check works. if [[ -d "$backup_path/DCIM" && \ -n $(find "$backup_path/DCIM" -iregex "$photoregex" -print -quit | head) ]]; then echo "Found photos" |