Sfoglia il codice sorgente

sftp-into-eye: don't `es x info` three times

master
Ivan Kozik 1 mese fa
parent
commit
82634ba06c
1 ha cambiato i file con 6 aggiunte e 5 eliminazioni
  1. +6
    -5
      sftp-into-eye

+ 6
- 5
sftp-into-eye Vedi File

@@ -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.
(


Caricamento…
Annulla
Salva