2 次程式碼提交

作者 SHA1 備註 提交日期
  Ivan Kozik 5406e19a0f Add note 1 月之前
  Ivan Kozik 4b33d8d315 sftp-into-eye: factor out $RCLONE_DEST 1 月之前
共有 1 個檔案被更改,包括 5 行新增1 行删除
分割檢視
  1. +5
    -1
      sftp-into-eye

+ 5
- 1
sftp-into-eye 查看文件

@@ -20,6 +20,8 @@ wait-until-jobs-below() {
# provide as stdin the output of e.g.
# es x find -t f -- ~/stash/YouTube | take-wanted-ids ~/dead-video-ids | rg '\.(mp4|webm|flv|video)$'

RCLONE_DEST=jeff

while read i; do
echo $i

@@ -40,9 +42,11 @@ while read i; do
# 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.
(
es x get -s -- "$i" && \
rclone --metadata --inplace --size-only --progress copyto "$i" "jeff:$eye_path" && \
rclone --metadata --inplace --size-only --progress copyto "$i" "$RCLONE_DEST:$eye_path" && \
curl --fail-with-body -u "ya: ." -X POST -d "{\"file_id\": $file_id, \"location\": \"the-eye\", \"pathname\": \"$eye_path\"}" https://ya.borg.xyz/cgi-bin/new-namedfiles && \
curl -X POST -d "{\"the_eye_any_bytes_saved\": $size, \"the_eye_video_bytes_saved\": $the_eye_video_bytes_saved, \"the_eye_any_files_saved\": 1, \"the_eye_video_files_saved\": $the_eye_video_files_saved}" "http://eye.borg.xyz:31416/metrics" || true;
rm -f -- "$i"


Loading…
取消
儲存