feat(torrent_qbittorrent): move torrent scripts to docker backup

change torrent scp to mediahost to cp to nfs directory
This commit is contained in:
lucas committed 2026-11-09 20:40:46 +01:00
1 parent 927b650e86
commit f10157792c
2 files changed
+20 -37

No files matched your search

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