Windows Command Line to create Linux LN Hardlink Command String
-
- Posts: 10
- Joined: 27 Feb 2018, 22:43
Windows Command Line to create Linux LN Hardlink Command String
Goal: a command line string that I can run at a Windows PC command line which will create the Linux LN command line string to create a desired hardlink.
Situation: I have a Google spreadsheet that takes four inputs:
(1) Source Path (example: "/media/sdu1/soonerlater/private/deluge/data/")
(2) Source Filename (example: "somestupidshow.S03E011080p.ATVP.WEB-DL.DDP5.1.H.264-NTb.mkv")
(3) Target Path: (example: "/media/sdu1/soonerlater/private/plexmedia/tv/")
(4) Target Filename: ("Some Stupid Show 3x01 - George Gets Even.mkv")
For step # 4, I use theTVDb or theMovieDb to create an appropriate filename.
The spreadsheet uses a formula to use the above four inputs to create this output:
"ln "/media/sdu1/soonerlater/private/deluge/data/somestupidshow.S03E011080p.ATVP.WEB-DL.DDP5.1.H.264-NTb.mkv" "/media/sdu1/soonerlater/private/plexmedia/tv/Some Stupid Show 3x01 - George Gets Even.mkv"
I then copy the output from the spreadsheet and paste it into SSH terminal window (e.g. Putty or Kitty) to run the LN command on my seedbox. When the command works correctly, it creates a hardlink that the Plex Server running on my seedbox can then use. This lets me keep files that I'm seeding in the folder shown in #1 above, but have a separate folder containing nothing but hardlinks with "cleaned up" names that Plex can use.
What I would like is a way to use FileBot at a Windows command line to create the "LN" command output that my current method creates. Is there a way to do that?
Clear as mud?
Situation: I have a Google spreadsheet that takes four inputs:
(1) Source Path (example: "/media/sdu1/soonerlater/private/deluge/data/")
(2) Source Filename (example: "somestupidshow.S03E011080p.ATVP.WEB-DL.DDP5.1.H.264-NTb.mkv")
(3) Target Path: (example: "/media/sdu1/soonerlater/private/plexmedia/tv/")
(4) Target Filename: ("Some Stupid Show 3x01 - George Gets Even.mkv")
For step # 4, I use theTVDb or theMovieDb to create an appropriate filename.
The spreadsheet uses a formula to use the above four inputs to create this output:
"ln "/media/sdu1/soonerlater/private/deluge/data/somestupidshow.S03E011080p.ATVP.WEB-DL.DDP5.1.H.264-NTb.mkv" "/media/sdu1/soonerlater/private/plexmedia/tv/Some Stupid Show 3x01 - George Gets Even.mkv"
I then copy the output from the spreadsheet and paste it into SSH terminal window (e.g. Putty or Kitty) to run the LN command on my seedbox. When the command works correctly, it creates a hardlink that the Plex Server running on my seedbox can then use. This lets me keep files that I'm seeding in the folder shown in #1 above, but have a separate folder containing nothing but hardlinks with "cleaned up" names that Plex can use.
What I would like is a way to use FileBot at a Windows command line to create the "LN" command output that my current method creates. Is there a way to do that?
Clear as mud?
Re: Windows Command Line to create Linux LN Hardlink Command String
FileBot fundamentally cannot process non-existent file paths, and also cannot generate command-line scripts to be executed on other machines.
You can however log into your Linux machine via SSH, then install filebot on your Linux machine, then run filebot on your Linux machine to move/rename files:
https://www.filebot.net/cli.html
You can also mount the remote file system onto your local Windows machine, and then rename files with the FileBot Desktop application as if you were renaming local files on your local Windows computer. There are many tools (e.g.
Mountain Duck) that can make a remote Linux file systems available as a network drive on your Windows Desktop PC. Google is your friend here. Please report back if you take this path and what software ended up working for you.

https://www.filebot.net/cli.html

Mountain Duck) that can make a remote Linux file systems available as a network drive on your Windows Desktop PC. Google is your friend here. Please report back if you take this path and what software ended up working for you.
-
- Posts: 10
- Joined: 27 Feb 2018, 22:43
Re: Windows Command Line to create Linux LN Hardlink Command String
I am evaluating Mountain Duck and it looks awesome. With it I am able to mount my cloud storage as local storage on my Windows PC and use FileBot on it like the files were local. However, I have one question: how can I have Filebot create a hardlink *AND* place that hardlink in a location different from the source file? When I try to have FileBot create a hardlink, it seems to try to place the hardlink in the same folder as the source file.
-
- Posts: 10
- Joined: 27 Feb 2018, 22:43
Re: Windows Command Line to create Linux LN Hardlink Command String
What am I doing wrong?

=================


=================

Re: Windows Command Line to create Linux LN Hardlink Command String
SoonerLater wrote: ↑16 Mar 2023, 16:54 When I try to have FileBot create a hardlink, it seems to try to place the hardlink in the same folder as the source file.




-
- Posts: 10
- Joined: 27 Feb 2018, 22:43
Re: Windows Command Line to create Linux LN Hardlink Command String
I tried this at the Windows command line:
What it produced is this:
Although I can use Mountain Duck to write files to the desired folder on the remote Linux server, it seems that either FileBot can't create the hardlinks (not likely) or that Mountain Duck doesn't allow Filebot to create the hardlinks (far more likely).
FWIW... I've reached out to the makers of Mountain Duck to see what they say.
Code: Select all
D:\private>filebot -rename --action hardlink D:/private/deluge/data/yellowstone.2018.s05e08.1080p.web.h264-glhf.mkv --db TheTVDB -non-strict --format D:/private/plexmedia/tv/{n}-{s00e00}-{t}
Code: Select all
Rename episodes using [TheTVDB] with [Airdate Order]
Lookup via [Yellowstone, Yellowstone] [yellowstone 2018]
Fetching episode data for [Yellowstone]
└─ 57 episodes
Fetching episode data for [Yellowstone]
└─ 6 episodes
[HARDLINK] from [D:\private\deluge\data\yellowstone.2018.s05e08.1080p.web.h264-glhf.mkv] to [D:\private\plexmedia\tv\Yellowstone (2018)-S05E08-A Knife and No Coin.mkv]
[HARDLINK] from [D:\private\deluge\data\yellowstone.2018.s05e08.1080p.web.h264-glhf.mkv] to [D:\private\plexmedia\tv\Yellowstone (2018)-S05E08-A Knife and No Coin.mkv] failed due to I/O error [D:\private\plexmedia\tv\Yellowstone (2018)-S05E08-A Knife and No Coin.mkv -> D:\private\deluge\data\yellowstone.2018.s05e08.1080p.web.h264-glhf.mkv: The request is not supported]
Processed 0 files
FWIW... I've reached out to the makers of Mountain Duck to see what they say.
Re: Windows Command Line to create Linux LN Hardlink Command String

If you don't have root, and if your provider cannot install filebot for you, then you could try the portable package. If you want more manual control, then you can add the --mode interactive option.
-
- Posts: 10
- Joined: 27 Feb 2018, 22:43
Re: Windows Command Line to create Linux LN Hardlink Command String
I do not have root / sudo access to my seedbox. However, I'm allowed to install Filebot provided that I can simply copy a compiled binary to the correct location. I have tried using the "portable package" installation method, but it calls sudo, which I'm not allowed to use.
Is there somewhere that I can get the Filebot compiled binary for Linux?
Is there somewhere that I can get the Filebot compiled binary for Linux?
Re: Windows Command Line to create Linux LN Hardlink Command String
Yes. The tar.sh script uses curl to download the binary package. The URL is printed to the console output when you run the script:SoonerLater wrote: ↑19 Mar 2023, 01:28 Is there somewhere that I can get the Filebot compiled binary for Linux?
https://github.com/filebot/plugins/blob ... ler/tar.sh
SoonerLater wrote: ↑19 Mar 2023, 01:28 I have tried using the "portable package" installation method, but it calls sudo, which I'm not allowed to use.


Code: Select all
# [OPTIONAL] Link `filebot` into the $PATH
sudo ln -sf "$PWD/filebot.sh" /usr/local/bin/filebot
-
- Posts: 10
- Joined: 27 Feb 2018, 22:43
Re: Windows Command Line to create Linux LN Hardlink Command String
What did the console output say?
Code: Select all
[myserver ~] java -version
openjdk version "1.8.0_322"
OpenJDK Runtime Environment (build 1.8.0_322-8u322-b06-1~deb9u1-b06)
OpenJDK 64-Bit Server VM (build 25.322-b06, mixed mode)
[myserver ~] ls
action.log Library private www
[myserver ~] mkdir filebot-portable
[myserver ~] cd filebot-portable
[myserver ~/filebot-portable] curl -fsSL https://raw.githubusercontent.com/filebot/plugins/master/installer/tar-jdk8.sh | sh -xu
+ PACKAGE_VERSION=5.0.1
+ curl -fsSL https://raw.githubusercontent.com/filebot/website/master/get.filebot.net/filebot/FileBot_5.0.1/FileBot_5.0.1-portable-jdk8.tar.xz.sha256
+ PACKAGE_SHA256=804cea3ee50472e7e552efc696ec67130f4dababfbb41f95bae052d758cc0a4c
+ PACKAGE_FILE=FileBot_5.0.1-portable-jdk8.tar.xz
+ PACKAGE_URL=https://get.filebot.net/filebot/FileBot_5.0.1/FileBot_5.0.1-portable-jdk8.tar.xz
+ curl -o FileBot_5.0.1-portable-jdk8.tar.xz -z FileBot_5.0.1-portable-jdk8.tar.xz https://get.filebot.net/filebot/FileBot_5.0.1/FileBot_5.0.1-portable-jdk8.tar.xz
Warning: Illegal date format for -z, --timecond (and not a file name).
Warning: Disabling time condition. See curl_getdate(3) for valid date syntax.
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 30.2M 100 30.2M 0 0 13.7M 0 0:00:02 0:00:02 --:--:-- 13.7M
+ echo 804cea3ee50472e7e552efc696ec67130f4dababfbb41f95bae052d758cc0a4c *FileBot_5.0.1-portable-jdk8.tar.xz
+ sha256sum --check
FileBot_5.0.1-portable-jdk8.tar.xz: OK
+ tar xvf FileBot_5.0.1-portable-jdk8.tar.xz
filebot.sh
jar/args4j.jar
jar/bcpg.jar
jar/bcpkix.jar
jar/bcprov.jar
jar/bcutil.jar
jar/bencode.jar
jar/caffeine.jar
jar/commons-email.jar
jar/commons-io.jar
jar/commons-logging.jar
jar/darcula.jar
jar/ehcache.jar
jar/failureaccess.jar
jar/filebot.jar
jar/flatlaf.jar
jar/glazedlists.jar
jar/groovy-datetime.jar
jar/groovy-dateutil.jar
jar/groovy-json.jar
jar/groovy-jsr223.jar
jar/groovy-nio.jar
jar/groovy-xml.jar
jar/groovy.jar
jar/guava.jar
jar/icu4j.jar
jar/imgscalr.jar
jar/istack-commons-runtime.jar
jar/ivy.jar
jar/jakarta.activation.jar
jar/jakarta.mail.jar
jar/jakarta.xml.bind-api.jar
jar/java-diff-utils.jar
jar/jaxb-core.jar
jar/jaxb-runtime.jar
jar/jna-platform.jar
jar/jna.jar
jar/json-io.jar
jar/jsoup.jar
jar/language-detector.jar
jar/lanterna.jar
jar/metadata-extractor.jar
jar/miglayout-core.jar
jar/miglayout-swing.jar
jar/rsyntaxtextarea.jar
jar/sevenzipjbinding.jar
jar/simmetrics-core.jar
jar/slf4j-api.jar
jar/slf4j-jdk14.jar
jar/xmlrpc.jar
jar/xmpcore.jar
jar/xz.jar
lib/Linux-armv7l/lib7-Zip-JBinding.so
lib/Linux-armv7l/libjnidispatch.so
lib/Linux-armv7l/libmediainfo.so
lib/Linux-armv7l/libz.so
lib/Linux-armv7l/libzen.so
lib/Linux-aarch64/libjnidispatch.so
lib/Linux-aarch64/libmediainfo.so
lib/Linux-aarch64/libz.so
lib/Linux-aarch64/libzen.so
lib/Linux-x86_64/lib7-Zip-JBinding.so
lib/Linux-x86_64/libjnidispatch.so
lib/Linux-x86_64/libmediainfo.so
lib/Linux-x86_64/libzen.so
lib/FreeBSD-amd64/libjnidispatch.so
maintainer.gpg
+ /media/sdu1/soonerlater/filebot-portable/filebot.sh -version
FileBot 5.0.1 (r9665) JDK8 (headless) / Groovy 4.0.9 / OpenJDK Runtime Environment 1.8.0_322 / Linux 4.19.123-feral (amd64)
+ sudo ln -sf /media/sdu1/soonerlater/filebot-portable/filebot.sh /usr/local/bin/filebot
[sudo] password for soonerlater:
soonerlater is not in the sudoers file. This incident will be reported.
Re: Windows Command Line to create Linux LN Hardlink Command String
The FileBot binary package was download from here:
A call to /media/sdu1/soonerlater/filebot-portable/filebot.sh confirms that filebot is indeed working:
The next step is to set up unattended automation with the amc script. You'll want to configure your download tools to call filebot on newly completed downloads. There are many ways to do this, depending on your specific environment.
EDIT:
Presumably, you're using tools such as rsync to periodically sync files onto your server. In this case, you could also just run filebot on your server in a very simple script that you then call on a schedule every half an hour:
The goal is to not to anything manually, so that things get synced and organized even if you're asleep or on holiday.
Code: Select all
https://get.filebot.net/filebot/FileBot_5.0.1/FileBot_5.0.1-portable-jdk8.tar.xz
Code: Select all
/media/sdu1/soonerlater/filebot-portable/filebot.sh -version
Code: Select all
FileBot 5.0.1 (r9665) JDK8 (headless) / Groovy 4.0.9 / OpenJDK Runtime Environment 1.8.0_322 / Linux 4.19.123-feral (amd64)

EDIT:
Presumably, you're using tools such as rsync to periodically sync files onto your server. In this case, you could also just run filebot on your server in a very simple script that you then call on a schedule every half an hour:
Code: Select all
# sync files from server
rsync ...
# process files with filebot and move them into the final plex folder structure
filebot ...
