From 81e1e23066661ebf09ff278b9c5841b57f561a37 Mon Sep 17 00:00:00 2001 From: Javis Sullivan Date: Sun, 7 Dec 2025 15:31:14 -0500 Subject: [PATCH] initial commit --- Makefile | 0 config.example.yaml | 41 +++++++++++++++++++++++++++++++++++++ config.yaml | 41 +++++++++++++++++++++++++++++++++++++ go.mod | 3 +++ internal/config/config.go | 0 internal/transfer/rsync.go | 0 internal/watcher/watcher.go | 0 mediawatcher.service | 0 8 files changed, 85 insertions(+) create mode 100644 Makefile create mode 100644 config.example.yaml create mode 100644 config.yaml create mode 100644 go.mod create mode 100644 internal/config/config.go create mode 100644 internal/transfer/rsync.go create mode 100644 internal/watcher/watcher.go create mode 100644 mediawatcher.service diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..e69de29 diff --git a/config.example.yaml b/config.example.yaml new file mode 100644 index 0000000..73db2ca --- /dev/null +++ b/config.example.yaml @@ -0,0 +1,41 @@ +watch: + # Directory to watch for new/changed media files + path: "/mnt/ipfsxfs/sabnzbd/downloads/complete" + # Watch subdirectories too + recursive: true + # How long the file size must remain unchanged before it is considered "stable" (seconds) + stable_seconds: 15 + # Optional patterns to include (empty means include everything) + include_globs: + - "*.mkv" + - "*.mp4" + - "*.avi" + - "*.flac" + - "*.mp3" + # Optional patterns to exclude + exclude_globs: + - "*.part" + - "*.tmp" + - "*.crdownload" + +transfer: + method: "rsync" + + rsync: + binary: "/usr/bin/rsync" + + ssh_user: "media" + ssh_host: "10.0.0.50" + ssh_port: 22 + + # Destination directory on remote server + dest_path: "/f2fs_mnt/incoming" + + # Extra rsync args (these are good defaults for large media files) + extra_args: + - "--partial" + - "--inplace" + - "--progress" + +logging: + level: "info" # "debug" | "info" | "error" diff --git a/config.yaml b/config.yaml new file mode 100644 index 0000000..73db2ca --- /dev/null +++ b/config.yaml @@ -0,0 +1,41 @@ +watch: + # Directory to watch for new/changed media files + path: "/mnt/ipfsxfs/sabnzbd/downloads/complete" + # Watch subdirectories too + recursive: true + # How long the file size must remain unchanged before it is considered "stable" (seconds) + stable_seconds: 15 + # Optional patterns to include (empty means include everything) + include_globs: + - "*.mkv" + - "*.mp4" + - "*.avi" + - "*.flac" + - "*.mp3" + # Optional patterns to exclude + exclude_globs: + - "*.part" + - "*.tmp" + - "*.crdownload" + +transfer: + method: "rsync" + + rsync: + binary: "/usr/bin/rsync" + + ssh_user: "media" + ssh_host: "10.0.0.50" + ssh_port: 22 + + # Destination directory on remote server + dest_path: "/f2fs_mnt/incoming" + + # Extra rsync args (these are good defaults for large media files) + extra_args: + - "--partial" + - "--inplace" + - "--progress" + +logging: + level: "info" # "debug" | "info" | "error" diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..062908f --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module belmontpt.org/m + +go 1.25.1 diff --git a/internal/config/config.go b/internal/config/config.go new file mode 100644 index 0000000..e69de29 diff --git a/internal/transfer/rsync.go b/internal/transfer/rsync.go new file mode 100644 index 0000000..e69de29 diff --git a/internal/watcher/watcher.go b/internal/watcher/watcher.go new file mode 100644 index 0000000..e69de29 diff --git a/mediawatcher.service b/mediawatcher.service new file mode 100644 index 0000000..e69de29