From 4b33d8d3153434904a0d1071287f357e16fd9bc8 Mon Sep 17 00:00:00 2001 From: Ivan Kozik Date: Fri, 12 Apr 2024 12:46:52 +0000 Subject: [PATCH] sftp-into-eye: factor out $RCLONE_DEST --- sftp-into-eye | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sftp-into-eye b/sftp-into-eye index 206ffe0..28a7445 100755 --- a/sftp-into-eye +++ b/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 @@ -42,7 +44,7 @@ while read i; do ( 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"