mirror of
https://github.com/Radarr/Radarr.git
synced 2024-09-28 12:17:18 +02:00
Added reverse symlinking
parent
54cb546dde
commit
981a2ce4fe
@ -53,3 +53,32 @@ Radarr can execute a custom script when new episodes are imported or a series is
|
||||
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).
|
||||
#### 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```
|
Loading…
Reference in New Issue
Block a user