feat(torrent_qbittorrent): move torrent scripts to docker backup
change torrent scp to mediahost to cp to nfs directory
This commit is contained in:
1 parent
927b650e86
commit
f10157792c
2 files changed
+20
-37
No files matched your search
File renamed without changes.
+20
-37
@@ -87,22 +87,22 @@ if [[ "$CATEGORY" != *arr* && "$CATEGORY" != "mytorrents" ]]; then
|
|||||||
echo "Category: $CATEGORY"
|
echo "Category: $CATEGORY"
|
||||||
echo "=================================================="
|
echo "=================================================="
|
||||||
|
|
||||||
###############################################################################
|
# ###############################################################################
|
||||||
# Check for scp command
|
# # Check for scp command
|
||||||
###############################################################################
|
# ###############################################################################
|
||||||
|
#
|
||||||
if ! command -v scp >/dev/null 2>&1; then
|
# if ! command -v scp >/dev/null 2>&1; then
|
||||||
echo "Install scp"
|
# echo "Install scp"
|
||||||
sed -i 's|http://|https://|g' /etc/apk/repositories
|
# sed -i 's|http://|https://|g' /etc/apk/repositories
|
||||||
for i in {1..12}; do
|
# for i in {1..12}; do
|
||||||
if apk add --no-cache openssh-client; then
|
# if apk add --no-cache openssh-client; then
|
||||||
break
|
# break
|
||||||
fi
|
# fi
|
||||||
|
#
|
||||||
echo "Retry $i/12"
|
# echo "Retry $i/12"
|
||||||
sleep 5
|
# sleep 5
|
||||||
done
|
# done
|
||||||
fi
|
# fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -138,27 +138,15 @@ if [[ "$CATEGORY" != *arr* && "$CATEGORY" != "mytorrents" ]]; then
|
|||||||
# Copy torrent to mediahost
|
# 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
|
||||||
echo "--- Copying torrent to mediahost ---"
|
echo "--- Copying torrent to mediahost ---"
|
||||||
echo "Source: $ROOT_PATH"
|
echo "Source: $ROOT_PATH"
|
||||||
echo "Destination: mediahost:/torrent/qbittorrent/mediahost/"
|
echo "Destination: mediahost:/torrent/qbittorrent/mediahost/"
|
||||||
|
|
||||||
ssh -i /config/.ssh/id_ed25519 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null \
|
cp -r "$ROOT_PATH" /mediahost/
|
||||||
lucas@mediahost "mkdir -p \"/torrent/qbittorrent/mediahost/$remote_dir\""
|
CP_STATUS=$?
|
||||||
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=$?
|
|
||||||
|
|
||||||
echo "scp exit status: $SCP_STATUS"
|
echo "scp exit status: $CP_STATUS"
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# Result
|
# Result
|
||||||
@@ -170,13 +158,8 @@ if [[ "$CATEGORY" != *arr* && "$CATEGORY" != "mytorrents" ]]; then
|
|||||||
if [[ $MQTT_STATUS -ne 0 ]]; then
|
if [[ $MQTT_STATUS -ne 0 ]]; then
|
||||||
echo "WARNING: torrent_mqtt.py failed."
|
echo "WARNING: torrent_mqtt.py failed."
|
||||||
fi
|
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."
|
echo "Torrent transfer completed successfully."
|
||||||
else
|
else
|
||||||
echo "ERROR: Torrent transfer failed."
|
echo "ERROR: Torrent transfer failed."
|
||||||
Reference in new issue
Block a user