Possible?

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
Cuzinshaggy
Posts: 2
Joined: 30 Jul 2013, 23:05

Possible?

Post by Cuzinshaggy »

Is it possible to script this workflow.......

watch a folder on a server through sftp
download whatever pops up to a local folder
delete the original folder that popped up
If necessary unrar file(s) inside downloaded folder
then move downloaded folder to another local folder

I don't even know if this is possible, but I imagine someone here would. I don't really have the time to figure this out on my own, so I figured I would give asking here a shot!
skchopperguy
Posts: 16
Joined: 21 Jul 2013, 12:59

Re: Possible?

Post by skchopperguy »

I can tell you that filebot would need to be running on the server. It cannot 'view' a remote server using sftp. Watcher script might be what you need. I have not used it, but lots of posts on that.

All current scripts are here: http://filebot.net/scripts/

If you can understand: http://filebot.net/scripts/watcher.groovy

you are on the right track ;)
Cuzinshaggy
Posts: 2
Joined: 30 Jul 2013, 23:05

Re: Possible?

Post by Cuzinshaggy »

I can actually work out the sftp "watch" part with Bitkinex. I was just shooting for a one tool answer. I have tried to set this up with Bitkinex doing the watching and downloading, and Sickbeard sorting and renaming what is downloaded. This works fine, until Sickbeard fires post-processing while Bitkinex is mid-download. I haven't found a way to work around this yet. I figured if one program handled it all, then it would'nt touch the folder until the download was finished.
skchopperguy
Posts: 16
Joined: 21 Jul 2013, 12:59

Re: Possible?

Post by skchopperguy »

Well, if bitkinex can move the file to a temp folder after its finished downloading, you could then drop Sickbeard altogether and use filebot on that directory for fetching/renaming/sorting into your final destination. Or point Sickbeard to that temp folder and let it do its thing.

I'm working on a similar concept ATM. Don't need Sickbeard features though. Just want to organize everything and pull down metadata nfo and images for local xbmc scan, so it doesn't need to go off to the net and pull anything. I'm getting close ;)

[EDIT]
Woops, sorry...I just saw on the website "Transfer files from and to any server via FTP/SCP/SFTP and run commands via SSH" so I guess you can do everything with Filebot. Not sure how that works though, didn't mean to point you in the wrong direction.
User avatar
rednoah
The Source
Posts: 22980
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Possible?

Post by rednoah »

The "watch files" part you wanna reconsider. You'll need figure this one out yourself.

Simple SFTP file transfers work via Groovy Ant but you'll probably wanna find a mirroring tool and just run that every hour. This whole thing screams rsync. :D

Just run rsync from the filebot script via execute(...) into a new folder and set rsync up to delete the original files after transfer.

This is probably what your filebot script is gonna do:
1. Mirror into new folder on pc
2. Delete files already mirrored from server
3. Run AMC on the new folder (that only contains this batch of files)

Also should you need to execute commands via SSH you can use this:

Code: Select all

sshexec(command: "ps", host: "filebot.sf.net", username: "rednoah", password: "correcthorsebatterystaple")
:idea: Please read the FAQ and How to Request Help.
Post Reply