-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: zakary <[email protected]>
- Loading branch information
1 parent
af296a5
commit b0fd592
Showing
16 changed files
with
376 additions
and
317 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# .env | ||
# Environment Configuration StarrScripts Sample 2024-04 | ||
# Rename this file to .env and fill in the values accordingly. | ||
# Xseed | ||
## Download Client Names | ||
TORRENT_CLIENT_NAME="" # Example: "Qbit" | ||
USENET_CLIENT_NAME="" # Example: "SABnzbd" | ||
## Cross Seed API configuration | ||
XSEED_HOST="" # Example: "crossseed" | ||
XSEED_PORT="" # Example: "2468" | ||
## API Key for Cross Seed, if applicable | ||
XSEED_APIKEY="" # Example: "your-api-key" | ||
## Path to store the script's database of prior searches | ||
LOG_FILE="" # Example: "/config/xseed_db.log" | ||
# ZFS Destory | ||
VERBOSE=0 | ||
MAX_FREQ=2 | ||
MAX_HOURLY=2 | ||
MAX_DAILY=1 | ||
MAX_WEEKLY=0 | ||
MAX_MONTHLY=0 | ||
# Jdupes | ||
JDUPES_OUTPUT_LOG="" # Example: "/.config/jdupes.log" | ||
JDUPES_SOURCE_DIR="" # Example: "/mnt/data/media/" | ||
JDUPES_DESTINATION_DIR="" # Example: "/mnt/data/torrents/" | ||
JDUPES_HASH_DB="" # Example: "/.config/jdupes_hashdb" | ||
# Qbittorrent Manage | ||
QBIT_MANAGE_LOCK_FILE_PATH="" # Example: "/var/lock/qbm-qbit.lock" | ||
QBIT_MANAGE_PATH="" # Example: "/opt/qbit-manage" | ||
QBIT_MANAGE_VENV_PATH="" # Example: "/opt/qbit-manage/.venv" | ||
QBIT_MANAGE_CONFIG_PATH="" # Example: "/opt/qbit-manage/config.yml" | ||
QBIT_MANAGE_OPTIONS="" # Example: "-cs -re -cu -tu -ru -sl -r" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -348,3 +348,6 @@ MigrationBackup/ | |
|
||
# Ionide (cross platform F# VS Code tools) working folder | ||
.ionide/ | ||
|
||
# Ignore .env | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"cSpell.words": [ | ||
"hashdb", | ||
"zfsburn" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,29 @@ | ||
#!/bin/bash | ||
|
||
jdupes_command="/usr/bin/jdupes" | ||
exclude_dirs="-X nostr:.RecycleBin -X nostr:.trash" | ||
include_ext="-X onlyext:mp4,mkv,avi" | ||
output_log="/.config/jdupes.log" | ||
source_dir="/mnt/data/media/" | ||
destination_dir="/mnt/data/torrents/" | ||
hash_db="/.config/jdupes_hashdb" | ||
# Load environment variables from .env file | ||
# Load environment variables from .env file if it exists | ||
if [ -f ".env" ]; then | ||
# shellcheck source=.env | ||
source ".env" | ||
fi | ||
# Variables | ||
JDUPES_OUTPUT_LOG=${JDUPES_OUTPUT_LOG:-"/var/log/jdupes.log"} | ||
JDUPES_SOURCE_DIR=${JDUPES_SOURCE_DIR:-"/mnt/data/media/"} | ||
JDUPES_DESTINATION_DIR=${JDUPES_DESTINATION_DIR:-"/mnt/data/torrents/"} | ||
JDUPES_HASH_DB=${JDUPES_HASH_DB:-"/var/lib/jdupes_hashdb"} | ||
## Secret Variables | ||
JDUPES_COMMAND=${JDUPES_COMMAND:-"/usr/bin/jdupes"} | ||
JDUPES_EXCLUDE_DIRS=${JDUPES_EXCLUDE_DIRS:-"-X nostr:.RecycleBin -X nostr:.trash"} | ||
JDUPES_INCLUDE_EXT=${JDUPES_INCLUDE_EXT:-"mp4,mkv,avi"} | ||
|
||
# Logging the start of the operation | ||
timestamp=$(date +"%Y-%m-%d %H:%M:%S") | ||
echo "[$timestamp] Duplicate search started for $source_dir and $destination_dir." >> "$output_log" | ||
$jdupes_command $exclude_dirs $include_ext -L -r -Z -y "$hash_db" "$source_dir" "$destination_dir" >> "$output_log" | ||
echo "[$timestamp] Duplicate search started for $JDUPES_SOURCE_DIR and $JDUPES_DESTINATION_DIR." >>"$JDUPES_OUTPUT_LOG" | ||
echo "command is" | ||
# Running jdupes with the loaded environment variables | ||
echo "$JDUPES_COMMAND" "$JDUPES_EXCLUDE_DIRS" "$JDUPES_INCLUDE_EXT" -L -r -Z -y "$JDUPES_HASH_DB" "$JDUPES_SOURCE_DIR" "$JDUPES_DESTINATION_DIR" | ||
"$JDUPES_COMMAND" "$JDUPES_EXCLUDE_DIRS" -X onlyext:"$JDUPES_INCLUDE_EXT" -L -r -Z -y "$JDUPES_HASH_DB" "$JDUPES_SOURCE_DIR" "$JDUPES_DESTINATION_DIR" >>"$JDUPES_OUTPUT_LOG" | ||
|
||
# Logging the completion of the operation | ||
timestamp=$(date +"%Y-%m-%d %H:%M:%S") | ||
echo "[$timestamp] Duplicate search completed for $source_dir and $destination_dir." >> "$output_log" | ||
echo "[$timestamp] Duplicate search completed for $JDUPES_SOURCE_DIR and $JDUPES_DESTINATION_DIR." >>"$JDUPES_OUTPUT_LOG" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.