mirror of
https://github.com/SinTan1729/random.git
synced 2024-12-25 04:48:37 -06:00
Add dedup_qbt_torrents.sh
This commit is contained in:
parent
af3d80d729
commit
426b6300ca
1 changed files with 15 additions and 0 deletions
15
dedup_qbt_torrents.sh
Normal file
15
dedup_qbt_torrents.sh
Normal file
|
@ -0,0 +1,15 @@
|
|||
#!/bin/sh
|
||||
|
||||
# I have st up qBittorrent to save the .torrent files for both incomplete and complete
|
||||
# torrents in the same folder, so it creates duplicate files.
|
||||
# This script removes duplicate .torrent files form qBittorrent's .torrent backup folder.
|
||||
# I run this as a cronjob on my server.
|
||||
|
||||
[ -z "$1" ] && echo "No folder provided!" && exit 1
|
||||
|
||||
find "$1" -name '* 1.torrent' -print0 | while read -d $'\0' f
|
||||
do
|
||||
if [ -f "$(echo "$f" | sed 's/ 1.torrent/.torrent/')" ]; then
|
||||
rm "$f"
|
||||
fi
|
||||
done
|
Loading…
Reference in a new issue