Added reverse symlinking

Abzie 2017-02-05 00:00:14 +00:00
parent 54cb546dde
commit 981a2ce4fe
1 changed files with 30 additions and 1 deletions

@ -52,4 +52,33 @@ Radarr can execute a custom script when new episodes are imported or a series is
#### PHP ####
The information from Radarr will not be added to $_ENV as one might expect but should be included in the [$_SERVER variable](https://secure.php.net/manual/en/reserved.variables.server.php). A sample script to use this information to convert a file can be found [here](https://gist.github.com/karbowiak/7fb38d346e368edc9d1a).
#### PowerShell ####
Sample script using the Radarr environment variables to create EDL files for all episodes is [here](https://gist.github.com/RedsGT/e1b5f28e7b5b81e1e45378151e73ba5c).
Sample script using the Radarr environment variables to create EDL files for all episodes is [here](https://gist.github.com/RedsGT/e1b5f28e7b5b81e1e45378151e73ba5c).
#### Reverse Symlinking ####
When using private trackers, it is imperitive to continue seeding. By using this script `on Download` and `on Upgrade` moves the media to your root movie folder as set in Radarr, and will create a symlink in the original download location so you can continue to seed.
Symlinking is preferable over hardlinking in most cases as the root movie folder can be on a seperate drive or nfs mount, where hardlinks are impossible.
```sh
#!/bin/bash
PERMPATH="$radarr_moviefile_path"
LINKPATH="$radarr_moviefile_sourcepath"
if [ -f "$LINKPATH" ];
then
sleep 1
else
exit 1
fi
ORIGFILESIZE=$(stat -c%s "$LINKPATH")
PERMFILESIZE=$(stat -c%s "$PERMPATH")
#env > /opt/radarr/Logs/env.log
sleep 30
while [ $PERMFILESIZE != $ORIGFILESIZE ]
do
sleep 60
PERMFILESIZE=$(stat -c%s "$PERMPATH")
done
if [ $PERMFILESIZE == $ORIGFILESIZE ]
then
rm "$LINKPATH"
ln -s "$PERMPATH" "$LINKPATH"
fi```