PDA

View Full Version : Seedbox download to local machine script?



Pozarynicoeta
11-11-2010, 06:50 AM
Hi all,

I'm thinking of writing a script that syncs my local machine with my seedbox's download directory. Both machines running *nix so will use bash or python.
Script will run on cron job on local machine, use sqlite db to check what files it hasn't downloaded already so to prevent redownloading if I move or delete from local machine. Will download via rsync or other method from seedbox.

Advantages:
- Local machine doesn't need to be seeding (it has slow upload)
- Local machine can be turned off
- When I move or delete a movie form local machine then seedbox can still seed it, but local machine won't redownload since sqlite has this logged.
- Much better than manual FTP method commercial seedboxes providers expect you to do to retrieve your files as this is done in background plus keeps a log to prevent redownloading as explained above.

When I write it I will share here, but want to know if anyone has done this already so I don't waste my time...


EDIT: just to be clear I'm talking about one way syncing - meaning downloading files from seedbox to local machine only, not other way around.

Jungleboy
11-11-2010, 09:03 AM
Did you think about doing it with rsync?

Cabalo
11-11-2010, 10:20 AM
Looks definitely interesting, and I know I could use it.
Please keep us informed. Bookmarked.

ca_aok
11-12-2010, 05:34 PM
If you set up keyfile SSH authentication to your local machine (aka, so you won't be prompted for a password for SSH connections), you could try something like this (if you use rtorrent):

Put this into your .rtorrent.rc:

system.method.set_key = event.download.finished,send_me,"execute=/path/to/send.sh,$d.get_directory="Then make send.sh, and chmod it to be executable:

#!/bin/bash

DIRECTORY=$1

sftp user@homeaddress
put $DIRECTORY
exit

fiThis is completely untested and I have no idea if it'll actually work, but in theory it should.

For this to work, you'd need:
-rtorrent on your remote machine
-an SFTP server on your home machine
-Keyfile authentication on your home machine
-A static home IP or some sort of domain name (I recommend using No-IP if you have a dynamic IP)

heiska
11-12-2010, 10:20 PM
If you set up keyfile SSH authentication to your local machine (aka, so you won't be prompted for a password for SSH connections), you could try something like this (if you use rtorrent):

Put this into your .rtorrent.rc:
Then make send.sh, and chmod it to be executable:

#!/bin/bash

DIRECTORY=$1

sftp user@homeaddress
put $DIRECTORY
exit

fiThis is completely untested and I have no idea if it'll actually work, but in theory it should.

For this to work, you'd need:
-rtorrent on your remote machine
-an SFTP server on your home machine
-Keyfile authentication on your home machine
-A static home IP or some sort of domain name (I recommend using No-IP if you have a dynamic IP)
That, and
Send.sh should check whether the local machine is up. If it wasn't, it should write the location of the downloaded files to a log file. The local machine has a cron job to query the remote log file for new completed downloads, and obviously make the seedbox to FTP the files to home.

jallen100
11-20-2010, 12:09 AM
Wow that sounds like a great idea. It would come in very handy!

Pozarynicoeta
08-28-2011, 09:57 PM
After creating the script in a few different languages (bash, C#, PHP) I found a solution that was simple and easy to understand in Python3 (my new favorite scripting language!).

I wrote it as a guide here http://filesharingtalk.com/threads/436669-One-way-syncing-downloads-from-seedbox-to-home?prefixid=bittorrent

vBooM
09-03-2011, 12:08 AM
This has been done on scc, check out the forums