diff --git a/Filesystem/File Organisation/README.md b/Filesystem/File Organisation/README.md new file mode 100644 index 0000000..4e5302e --- /dev/null +++ b/Filesystem/File Organisation/README.md @@ -0,0 +1,8 @@ +## Audio Organizer + +This Python Script will reorganize your music collection and also determine doubles and such in a dedicated text file. +The inital purpose of this script was to sort and reorganize over one terabyte of music. By doing it manually, iv probably wasted a lot of time. + +Audio Organizer does sort the music into the albums catogory. +You do the best by giving it another folder. No files will be copied. Instead it will be sorted and moved into new folders. +So allow Audio Organizer a dedicated folder for it's work. diff --git a/Filesystem/Transfer/scp-transfer b/Filesystem/Transfer/scp-transfer new file mode 100644 index 0000000..5d49daa --- /dev/null +++ b/Filesystem/Transfer/scp-transfer @@ -0,0 +1,57 @@ +#!/usr/bin/env bash + +# ----------------------------------------------------------------------------- +# Title: scp-transfer +# Developer: h@x +# Date: 13. July 2025 +# Purpose: Flexible SCP file transfer with user, host, port, and path flags +# ----------------------------------------------------------------------------- + +set -euo pipefail + +usage() { + echo "Usage: $0 -u -h -p -r -l [-d direction]" + echo " -u SSH username (required)" + echo " -h Remote host/IP (required)" + echo " -p SSH port (required)" + echo " -r Remote path (required)" + echo " -l Local file or directory (required)" + echo " -d Direction: 'upload' (default) or 'download'" + exit 1 +} + +USER="" +HOST="" +PORT="" +REMOTE_PATH="" +LOCAL_FILE="" +DIRECTION="upload" + +while getopts ":u:h:p:r:l:d:" opt; do + case $opt in + u) USER="$OPTARG" ;; + h) HOST="$OPTARG" ;; + p) PORT="$OPTARG" ;; + r) REMOTE_PATH="$OPTARG" ;; + l) LOCAL_FILE="$OPTARG" ;; + d) DIRECTION="$OPTARG" ;; + *) usage ;; + esac +done + +# Validate required parameters +if [[ -z "$USER" || -z "$HOST" || -z "$PORT" || -z "$REMOTE_PATH" || -z "$LOCAL_FILE" ]]; then + usage +fi + +# Perform SCP transfer based on direction +if [[ "$DIRECTION" == "upload" ]]; then + echo "Uploading $LOCAL_FILE to $USER@$HOST:$REMOTE_PATH (port $PORT)..." + scp -P "$PORT" -r "$LOCAL_FILE" "$USER@$HOST:$REMOTE_PATH" +elif [[ "$DIRECTION" == "download" ]]; then + echo "Downloading $USER@$HOST:$REMOTE_PATH to $LOCAL_FILE (port $PORT)..." + scp -P "$PORT" -r "$USER@$HOST:$REMOTE_PATH" "$LOCAL_FILE" +else + echo "Invalid direction: $DIRECTION" + usage +fi