rclone move after filebot renames

Running FileBot from the console, Groovy / FileBot scripting, shell scripts, etc
Post Reply
Arsia
Posts: 18
Joined: 05 Oct 2018, 02:08

rclone move after filebot renames

Post by Arsia » 30 Oct 2018, 12:52

I'm using the following script with Deluge

Code: Select all

#!/bin/bash

export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8
export LC_CTYPE="en_US.UTF-8"

TORRENT_PATH="$3/$2"
TORRENT_NAME="$2"
TORRENT_LABEL="N/A"

# Subtitle language
SUBLANG=en
SKIP_EXTRACT=n
MUSIC=y


filebot -script /opt/filebot/scripts/amc.groovy \
    --output "$HOME/media" \
    -non-strict --encoding utf8 --log all --log-file amc-deluge.log --action hardlink --conflict override \
    --def artwork=true ut_kind=multi "ut_dir=$TORRENT_PATH" "ut_title=$TORRENT_NAME" subtitles=$SUBLANG \
        extractFolder="$HOME/files/_extracted" music=$MUSIC skipExtract=$SKIP_EXTRACT &
I'd like to add something along the lines of:

Code: Select all

rclone move "$HOME/media/$3/$2" gdrive:/ -L --delete-empty-src-dirs
But as far as I can tell, that will move the directory straight into the root of / rather than inside /Movies, /Music, etc.

Thank you!

User avatar
rednoah
The Source
Posts: 16278
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: rclone move after filebot renames

Post by rednoah » 30 Oct 2018, 17:35

You can use --def exec to call arbitrary commands after the amc script is done processing files.

e.g.

Code: Select all

--def exec="echo {quote f}"
:idea: Please read the FAQ and How to Request Help.

tpc
Posts: 5
Joined: 04 Dec 2017, 01:23

Re: rclone move after filebot renames

Post by tpc » 31 Oct 2018, 16:40

Where might I find documentation for the {quote f} part of the exec command and any other replacement values that can be used here? For example, I am interested in getting the destination path without the filename.

Thanks!
Licensed filebot supporter!

User avatar
rednoah
The Source
Posts: 16278
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: rclone move after filebot renames

Post by rednoah » 01 Nov 2018, 04:04

I think you mean {folder} which will give you the folder path of {f}. The quote(String...) helper function is particularly useful for --def exec expressions to quote argument values.

All the custom format expression documentation applies just the same, except that you'll be generating a command instead of a file path:
https://www.filebot.net/naming.html

:idea: You can use the GUI Format Editor to prototype --def exec expressions.
:idea: Please read the FAQ and How to Request Help.

tpc
Posts: 5
Joined: 04 Dec 2017, 01:23

Re: rclone move after filebot renames

Post by tpc » 01 Nov 2018, 15:36

Thanks! I've used filebot command line for years but have never tried the GUI.
Licensed filebot supporter!

Post Reply