Hey I'm not sure if this falls under the pluggin or feature space, but I see there is a handy feature to move completed torrents.
I would REALLY like it if there was a way to copy completed torrents to a folder of my choosing but leave the original torrents in place to facilitate seeding. I want this because I often change the tags on files (.mp3, for example) but then I can't seed those files because they have been altered.
Sure, it's inefficient to keep two copies of everything, but it really makes for better organization, and hard drives are cheap compared to my time and effort.
In summary, I want to be able to copy completed torrents (maybe the .torrent file too) in addition to move them, if I choose.
~ Sentinel
Copy Completed Torrents
Re: Copy Completed Torrents
Well, until this is implemented (if it ever is), the same thing could be achieved using the move torrent functionality, a small shell script and cron. If you have 2 folders, one for unfinished dls and another for finished dls, then move completed downloads to the finished folder, you could then set up a cron job to run every 30 mins (for example) that calls a script which copies the contents of this finished folder to another folder of your choosing. I use something similar currently, except I use this system to automatically unrar downloads rather than copy them. Let me know if my script will be of any help.
Re: Copy Completed Torrents
Hi, I would love to have your script for automatic unrar, I've been thinking about writing a similar script, but haven't gotten around to it yet.Mindzai wrote:Well, until this is implemented (if it ever is), the same thing could be achieved using the move torrent functionality, a small shell script and cron. If you have 2 folders, one for unfinished dls and another for finished dls, then move completed downloads to the finished folder, you could then set up a cron job to run every 30 mins (for example) that calls a script which copies the contents of this finished folder to another folder of your choosing. I use something similar currently, except I use this system to automatically unrar downloads rather than copy them. Let me know if my script will be of any help.
Re: Copy Completed Torrents
So this actually wouldn't work because I will move things out of my completed folder to archive them, but I still want the originals in place to seed. So the cron job would copy stuff that I already moved out of the "to sort" folder. I'm really trying to make a "to sort" folder that will only contain files that I haven't sorted yet after I download them. But I also want to keep a copy unaltered for seeding in the "completed" folder.Mindzai wrote:Well, until this is implemented (if it ever is), the same thing could be achieved using the move torrent functionality, a small shell script and cron. If you have 2 folders, one for unfinished dls and another for finished dls, then move completed downloads to the finished folder, you could then set up a cron job to run every 30 mins (for example) that calls a script which copies the contents of this finished folder to another folder of your choosing. I use something similar currently, except I use this system to automatically unrar downloads rather than copy them. Let me know if my script will be of any help.
Do you see what I mean?
Re: Copy Completed Torrents
Hi - here is the script I use:tyskis wrote:Hi, I would love to have your script for automatic unrar, I've been thinking about writing a similar script, but haven't gotten around to it yet.
Code: Select all
#!/bin/sh
cd /media/disk/incoming/unpacking/
for file in $(find /media/disk/incoming/finished/ -iregex '.*\.\(rar\|001\)')
do
echo -n "checking file ${file##*/}..."
onblacklist=`grep -c $file /media/disk/incoming/unpacking/blacklist`
if [ $onblacklist -ne 0 ]; then
echo "already unpacked"
else
echo "not unpacked yet"
echo -n "unpacking..."
unrar e -inul -o- $file
echo "done!"
echo -n "adding to blacklist..."
echo $file >> /media/disk/incoming/unpacking/blacklist
echo "done!"
fi
done
ls -rt /media/disk/incoming/unpacking/ | grep -v '\(^unpack_torrents.sh$\|^blacklist$\|^cron.log$\)' | xargs -I{} mv {} /media/disk/incoming/unpacked/
Hmm maybe I'm not understanding what you are trying to do. My suggestion would automatically make a copy of any finished download and move it to a directory of your choice for sorting/deleting/whatever whilst leaving the finished file in place for seeding - is this not what you want to do? Just to clarify what I mean, deluge can automatically move all completed downloads to a certain directory where it will continue seeding them. The only reason for doing this is that you want only finished files to be copied by the script and moving finished files to a different location is the only way (that I know of) to accurately tell they they are finished. The script would then monitor this folder for any new files (referring to a blacklist as in the above script to avoid duplicate copies) and copy them to a 'to sort' location. So you end up with the original still seeding and a copy which you can do whatever you need to with.Sentinel wrote: So this actually wouldn't work because I will move things out of my completed folder to archive them, but I still want the originals in place to seed. So the cron job would copy stuff that I already moved out of the "to sort" folder. I'm really trying to make a "to sort" folder that will only contain files that I haven't sorted yet after I download them. But I also want to keep a copy unaltered for seeding in the "completed" folder.
Do you see what I mean?
Re: Copy Completed Torrents
Hmm, a blacklist might be the answer. But I think you can see how it would be a nice feature to implement and would take all of 20 lines of code from the Deluge team?
Re: Copy Completed Torrents
You could just as easily write a ui client script to do the same thing.
It wouldn't require that move torrent be enabled.
If you want it to be implemented in deluge, you could either write it as a patch and submit it as feature request (this doesn't necessarily mean it will be accepted though) or you could write it as a plugin (which is a step up from the ui client script).
It wouldn't require that move torrent be enabled.
If you want it to be implemented in deluge, you could either write it as a patch and submit it as feature request (this doesn't necessarily mean it will be accepted though) or you could write it as a plugin (which is a step up from the ui client script).
Re: Copy Completed Torrents
I looked at the source code and it was complicated, so I went with Mindzai's idea made it a cron script. I am using a 3-tier download system where files progress like so:
Downloading Folder ->[move]-> Seeding Folder ->[copy]-> Finished Folder
The blacklist makes it so I can freely modify the files in the finished folder and still have an untouched copy in the seeding folder. This is good for tag-editing or renaming files. Then, I take files out of the Finished Folder and put them in permanent archive.
Here's the code for my script, if anyone else would find this useful. It is designed to be used in conjunction with "Move on Complete" in order to get from the Downloading Folder to the Seeding Folder. Make sure you change the directories accordingly and "touch" the blacklist.txt file before your first run.
NOTE: For some reason grep fails on filenames that have more than one space in a row. If anyone knows a solution, please let me know. Otherwise, I think the script works well. Enjoy!
Downloading Folder ->[move]-> Seeding Folder ->[copy]-> Finished Folder
The blacklist makes it so I can freely modify the files in the finished folder and still have an untouched copy in the seeding folder. This is good for tag-editing or renaming files. Then, I take files out of the Finished Folder and put them in permanent archive.
Here's the code for my script, if anyone else would find this useful. It is designed to be used in conjunction with "Move on Complete" in order to get from the Downloading Folder to the Seeding Folder. Make sure you change the directories accordingly and "touch" the blacklist.txt file before your first run.
Code: Select all
#!/bin/bash
# Assumes that newly-finished torrent files are automatically
# moved to the SEEDING directory
# directory of finished torrents that are seeding
SEEDING=/mnt/Vault/Seeding/
# blacklist
BLACKLIST=/mnt/Vault/Finished/blacklist.txt
# where to move files for archival staging
# files can be edited and removed from this folder
# whithout affecting seeding copy
FINISHED=/mnt/Vault/Finished/
# for each file or folder in the SEEDING directory,
# check if it's on the blacklist
# if it is not, then recursively copy it to FINSIHED
# and add it to the blacklist
cd $SEEDING
echo Copying files from Seeding directory to Finished Directory...
for file in *
do
COUNT=`grep -cF "$file" $BLACKLIST`
if [ $COUNT == 0 ]; then
echo $file
cp -r "$file" $FINISHED
echo $file >> $BLACKLIST
fi
done
Re: Copy Completed Torrents
If you're mainly copying torrents so that you can rename them I should mention that from 1.1.0 you will be able to rename files within a torrent.
Re: Copy Completed Torrents
No, it's mainly so I can fix files with bad meta data and tags and still seed them.johnnyg wrote:If you're mainly copying torrents so that you can rename them I should mention that from 1.1.0 you will be able to rename files within a torrent.