Get a dir listing out of jail and into windows?

Status
Not open for further replies.

Wallybanger

Contributor
Joined
Apr 17, 2016
Messages
150
So the Transmission client is really bad at doing a lot of things. Not having multiple watch directories means that my torrent folder is a complete mess of files, some of which are active torrents and some of which are not.

I currently have 201 torrents seeding in my transmission client. My bittorrent folder has 446 files and directories.

I would love to move all of the inactive files out of my bittorrent directory and organize them in my media folder but doing this manually by going through the transmission list and comparing each torrent to files in my bittorrent directory sounds like an absolute hair-pulling nightmare.

Anyway, as with all FreeBSD stuff, I use the shell so infrequently that trying to learn and remember the commands is almost impossible.

It looks like inside the Transmission jail there is a directory /var/db/transmission/torrents that has a file for every torrent. I can't even get the shell to count the files for me so I don't even know if that directory has 201 files in it but I have my fingers crossed. What I would like to do is somehow print the directory listing to a text file and somehow get it into one of my SMB shares so I can actually work with it in windows. From there I can write a .bat file to some how mark or move all of the inactive files out of my bittorrent directory.

Anyone have any idea how I can do this? Am I going about this the right way or is there an easier way to get a torrent listing out of transmission?

For the record, I looked at the source in the web client and it appears to be a java script so I can't just pull the file names out of there. That would have been waaaayy too easy :rolleyes:
 

Redcoat

MVP
Joined
Feb 18, 2014
Messages
2,925
I don't have your configuration to test against, but will Midnight Commander, "mc" in the shell through ssh, get you what you want?
 

Wallybanger

Contributor
Joined
Apr 17, 2016
Messages
150
I don't have your configuration to test against, but will Midnight Commander, "mc" in the shell through ssh, get you what you want?
I have no idea what that is or how to use it.

My config is that I just have a jail running on freeNAS with Transmission in it and it saves all of my torrents into a media folder in my SMB share.

Now that I think about it, the transmission jail has write access to the media folder so I'm wondering if I can do some sort of a ls >files.txt and have it write directly to that media folder.
 

Wallybanger

Contributor
Joined
Apr 17, 2016
Messages
150
OK, update, got this to work by using
Code:
ls -1 /var/db/transmission/torrents >torrents.txt
file from the jail shell. What was throwing me for a loop was that notepad doesn't recognize the carriage return output by ls so I had to do a (CR LF) conversion in Notepad++

It took me 3hrs to figure that out :mad:

For reference, /var/db/transmission/torrents is in fact the folder that contains the current torrents loaded in transmission.
 

Redcoat

MVP
Joined
Feb 18, 2014
Messages
2,925
I have no idea what that is or how to use it.

Look here https://midnight-commander.org/

"GNU Midnight Commander is a visual file manager, licensed under GNU General Public License and therefore qualifies as Free Software. It's a feature rich full-screen text mode application that allows you to copy, move and delete files and whole directory trees, search for files and run commands in the subshell. Internal viewer and editor are included"

Try it, you might like it. It's built in to FreeNAS.

Glad you were able to accomplish your task anyway.
 

Wallybanger

Contributor
Joined
Apr 17, 2016
Messages
150
Look here https://midnight-commander.org/

"GNU Midnight Commander is a visual file manager, licensed under GNU General Public License and therefore qualifies as Free Software. It's a feature rich full-screen text mode application that allows you to copy, move and delete files and whole directory trees, search for files and run commands in the subshell. Internal viewer and editor are included"

Try it, you might like it. It's built in to FreeNAS.

Glad you were able to accomplish your task anyway.
Wow! Had no idea that was a thing and I had no idea it was built into freenas!! Awesome! Thanks!!

Ha, almost able to accomplish my task. I've been trying to write a batch file to highlight files and folders not currently used by transmission but the bugs in the command shell are driving me crazy. I have 2 strings that are (as far as I can tell) absolutely identical and a the if !var!==!var2! comparitor will not recognize the strings as identical :mad:

Nothing is easy :rolleyes:
 
Status
Not open for further replies.
Top