Integrating FileBot in a LFTP auto-download setup

Any questions? Need some help?
Post Reply
electricdoor
Posts: 3
Joined: 20 Jun 2013, 05:51

Integrating FileBot in a LFTP auto-download setup

Post by electricdoor »

I'm not too Linux-savvy yet, so pardon my lack of knowledge here. I just built this Debian server and have to Google just about everything I want to do. lol

I'm going to make a simple script to LFTP 'mirror' a directory on my seedbox (one for movies, one for TV since they're on different local SMB shares) to a local 'landing' directory that gets sorted by FileBot awesomeness, (but I guess I need to use it in KEEPLINK mode to prevent the same files being downloaded over and over agan) and toss it in Cron to run every 30 minutes or so.

Shorthand example: mirror ~/downloads/television /mnt/television/sortme, then FileBot --action keeplink from /mnt/television/sortme to /mnt/television/Library

First off, if there's a better way to do all of this, please tell me now. ;)

But primarily, will FileBot name the symlink EXACTLY as the original file was named, including extensions? This way, I could set LFTP into a no-overwrite mode so that I only download what I haven't downloaded before.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Integrating FileBot in a LFTP auto-download setup

Post by rednoah »

keeplink and symlink should both work since it'll keep the original file. Maybe symlink works best as it only creates symlinks and never touches the original file. Keeplinks moves the original file and then creates a symlink back at the original location. Really depends on what LFTP mirror will work with or have issues with.

Though if it's all on one filesystem i'd highly recommend using hardlink. That can't not work as you have a real file, except twice. Also SMB/NFS shared sometimes have issues with symlink being resolved client-side, that can't happen with hardlinks neither.
:idea: Please read the FAQ and How to Request Help.
electricdoor
Posts: 3
Joined: 20 Jun 2013, 05:51

Re: Integrating FileBot in a LFTP auto-download setup

Post by electricdoor »

I'm afraid to use hardlinks because these shares are daemon'ed by Greyhole and since the physical data gets moved between disks it would do some silly junk I'm sure.

To be clear: I don't give a crap about the links or their effectiveness. lol Just as long as there's a 'placeholder' to serve as a record in the landing directory that I've already downloaded episode x, so that LFTP doesn't download it again. XBMC builds its library from the Library directory, so even if the link breaks or malfunctions it won't matter because XBMC plays from the original file, not the link.

Do you think this is an effective/good method? Is there a better way?

And, to be clear: Will keeplink name the left-behind symlink exactly the way the original (non-renamed) file was named?
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Integrating FileBot in a LFTP auto-download setup

Post by rednoah »

Yes, that's the whole point of keeplink. It'll work.
:idea: Please read the FAQ and How to Request Help.
electricdoor
Posts: 3
Joined: 20 Jun 2013, 05:51

Re: Integrating FileBot in a LFTP auto-download setup

Post by electricdoor »

Alright, thanks a bunch. :)
alleyoopster
Posts: 2
Joined: 03 Oct 2013, 12:53

Re: Integrating FileBot in a LFTP auto-download setup

Post by alleyoopster »

I was just browsing through and found this post. I am interested in doing the same thing, but maybe using rsync or even mounting with SSHFS. What I was wondering was when using LFTP or rsync do you have any problems with filebot trying to work on part downloaded files. Did you find this or find a workaround?
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Integrating FileBot in a LFTP auto-download setup

Post by rednoah »

Depends on how you start filebot. Just call it and newly synced files after rsync is finished.
:idea: Please read the FAQ and How to Request Help.
alleyoopster
Posts: 2
Joined: 03 Oct 2013, 12:53

Re: Integrating FileBot in a LFTP auto-download setup

Post by alleyoopster »

I don't see a start or finish to the rsync or lftp process. If a episode is added at sometime automatically on the seedbox then this would automatically be synced to a directory on the local computer. What is changing is that a file / directory will be created and then downloaded. Filebot will periodically check the directory for new files, but not process the ones that are still copying, just the completed ones.

I had one thought, maybe there is a way of suffixing with .part and telling filebot to ignore part files or perhaps using SSHFS would work better.

I just noticed this post which uses sshexec looks promising.
User avatar
rednoah
The Source
Posts: 22923
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Integrating FileBot in a LFTP auto-download setup

Post by rednoah »

I'm sure there's a way. Though you probably have to figure out what the best way would be for your setup.

I would make a cron job that runs every few hours. Now this job would first call rsync and then filebot.
:idea: Please read the FAQ and How to Request Help.
Post Reply