From f10157792c1ae4ff360084b52b151cf83be44744 Mon Sep 17 00:00:00 2001 From: Lucas Serverhost Date: Mon, 9 Nov 2026 20:38:36 +0100 Subject: [PATCH] feat(torrent_qbittorrent): move torrent scripts to docker backup change torrent scp to mediahost to cp to nfs directory --- .../qbittorrent-scripts}/torrent_mqtt.py | 0 .../torrent_qbittorrent_complete.sh | 57 +++++++------------ 2 files changed, 20 insertions(+), 37 deletions(-) rename {torrent => docker_compose/serverhost/qbittorrent/qbittorrent-scripts}/torrent_mqtt.py (100%) rename {torrent => docker_compose/serverhost/qbittorrent/qbittorrent-scripts}/torrent_qbittorrent_complete.sh (76%) diff --git a/torrent/torrent_mqtt.py b/docker_compose/serverhost/qbittorrent/qbittorrent-scripts/torrent_mqtt.py similarity index 100% rename from torrent/torrent_mqtt.py rename to docker_compose/serverhost/qbittorrent/qbittorrent-scripts/torrent_mqtt.py diff --git a/torrent/torrent_qbittorrent_complete.sh b/docker_compose/serverhost/qbittorrent/qbittorrent-scripts/torrent_qbittorrent_complete.sh similarity index 76% rename from torrent/torrent_qbittorrent_complete.sh rename to docker_compose/serverhost/qbittorrent/qbittorrent-scripts/torrent_qbittorrent_complete.sh index 55604b2..88b08d4 100755 --- a/torrent/torrent_qbittorrent_complete.sh +++ b/docker_compose/serverhost/qbittorrent/qbittorrent-scripts/torrent_qbittorrent_complete.sh @@ -87,22 +87,22 @@ if [[ "$CATEGORY" != *arr* && "$CATEGORY" != "mytorrents" ]]; then echo "Category: $CATEGORY" echo "==================================================" - ############################################################################### - # Check for scp command - ############################################################################### - - if ! command -v scp >/dev/null 2>&1; then - echo "Install scp" - sed -i 's|http://|https://|g' /etc/apk/repositories - for i in {1..12}; do - if apk add --no-cache openssh-client; then - break - fi - - echo "Retry $i/12" - sleep 5 - done - fi +# ############################################################################### +# # Check for scp command +# ############################################################################### +# +# if ! command -v scp >/dev/null 2>&1; then +# echo "Install scp" +# sed -i 's|http://|https://|g' /etc/apk/repositories +# for i in {1..12}; do +# if apk add --no-cache openssh-client; then +# break +# fi +# +# echo "Retry $i/12" +# sleep 5 +# done +# fi @@ -138,27 +138,15 @@ if [[ "$CATEGORY" != *arr* && "$CATEGORY" != "mytorrents" ]]; then # Copy torrent to mediahost ############################################################################### - basename_root=$(basename "$ROOT_PATH") - echo $basename_root - if [ "$basename_root" = "downloads" ]; then - remote_dir="$TORRENT_NAME" - else - remote_dir="$basename_root" - fi - echo echo "--- Copying torrent to mediahost ---" echo "Source: $ROOT_PATH" echo "Destination: mediahost:/torrent/qbittorrent/mediahost/" - ssh -i /config/.ssh/id_ed25519 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \ - lucas@mediahost "mkdir -p \"/torrent/qbittorrent/mediahost/$remote_dir\"" - SSH_STATUS=$? - scp -i /config/.ssh/id_ed25519 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \ - -r "$ROOT_PATH"/. lucas@mediahost:/torrent/qbittorrent/mediahost/$remote_dir/ - SCP_STATUS=$? + cp -r "$ROOT_PATH" /mediahost/ + CP_STATUS=$? - echo "scp exit status: $SCP_STATUS" + echo "scp exit status: $CP_STATUS" ############################################################################### # Result @@ -170,13 +158,8 @@ if [[ "$CATEGORY" != *arr* && "$CATEGORY" != "mytorrents" ]]; then if [[ $MQTT_STATUS -ne 0 ]]; then echo "WARNING: torrent_mqtt.py failed." fi - if [[ $SSH_STATUS -eq 0 ]]; then - echo "Target Dir generated" - else - echo "ERROR: Target dir generation failed." - fi - if [[ $SCP_STATUS -eq 0 ]]; then + if [[ $CP_STATUS -eq 0 ]]; then echo "Torrent transfer completed successfully." else echo "ERROR: Torrent transfer failed."