diff --git a/sftp-into-eye b/sftp-into-eye index db8de88..1d3ef06 100755 --- a/sftp-into-eye +++ b/sftp-into-eye @@ -26,8 +26,12 @@ while read i; do echo $i eye_path=$(path-to-eye-path "$i" | sed -r "s,$HOME/stash/,,g") - file_id=$(es x info -- "$i" | jq .id) - size=$(es x info -- "$i" | jq .size) + info=$(es x info -- "$i") + file_id=$(echo "$info" | jq .id) + size=$(echo "$info" | jq .size) + + # If already in namedfiles i.e. the-eye, skip + echo "$info" | rg -q -F '"type": "namedfiles"' && continue || true is_video=0 echo -n "$i" | rg -q '\.(mp4|webm|flv|video)$' && is_video=1 || true @@ -39,9 +43,6 @@ while read i; do the_eye_video_files_saved=1 fi - # If already in namedfiles i.e. the-eye, skip - es x info -- "$i" | rg -q -F '"type": "namedfiles"' && continue || true - # This is mostly a demo which adds it to ceph over SFTP with `rclone`; # ideally we instead have the `es x get -s -- "$i"` step putting it directly into ceph. (