Move Directories based on Wildcard/Contains words

This is a general question, un related to specific version etc

I am trying to figure out how to Move directories based on a wildcard.

An example is let's say you wanted to move directories and it's sub directories, based on words contained in the directory name.

So an example would be this

Move all Directories containing this, 1 per line as examples:
(space)Season(Space)
.S0

So
*" Season "
*.S0

The other issue making sure you give rclone a specific path, and it would not go into the sub Directories, meaning it only finds Directories inside the given Directory it was given and not iterate through the sub directories.

remote:/path/Directory
and not
remote:/path/Directory/*

an example command line for this IF possible would be greatly appreciated

Maybe Wildcard is the wrong wording, as I would always be looking for Specific Text in the Directory name.

hello,
not sure i understand you request as a detailed example is missing.
here is an example of what i think you are requesting.
note: to make it easier to see the space character, i changed them to the character

rclone tree source
/
├──∙Season∙01
│  ├──∙Season∙01
│  │  └──file
│  └──file
├──Season∙01
│  └──∙Season∙01
│     └──file
└──file

4 directories, 4 files

rclone tree source --exclude-from=excludes.lst
/
├──Season∙01
│  └──∙Season∙01
│     └──file
└──file

2 directories, 2 files

and this is the contents of excludes.lst
/∙Season∙*/

More detailed explanation

So I would tell rclone this

I would write 3 command lines like this

rclone move remoteA:/Incoming/Ready/*.S0*/ remoteA:/TV.Series/
rclone move remoteA:/Incoming/Ready/* Season */ rclone remoteA:/TV.Series/
rclone move remoteA:/Incoming/Ready/*.Season.*/ rclone remoteA:/TV.Series/

This command:
rclone move remoteA:/Incoming/Ready/*.S0*/ remoteA:/TV.Series/

would move Directory
Ash.vs.Evil.Dead.S01.1080p.AMZN.WEBRip

to the remoteA:/TV.Series/

This command:
rclone move remoteA:/Incoming/Ready/* Season */ remoteA:/TV.Series/
would move these directories

American Horror Story Season 8 Complete 720p HDTV x264
Atypical (2017) Season 1 S01
Altered Carbon (2018) Season 1 S01
Altered Carbon (2018) Season 2 S02

to the remoteA:/TV.Series/

This command:
rclone move remoteA:/Incoming/Ready/*.Season.*/ remoteA:/TV.Series/
would move these directories
Alfred.Hitchcock.Presents.Season.1

Although I am using TV series as an example I have thousands of use cases where I want to move Directories based on the title of the directory

In your Example above you are showing the SUB Directories, I want to IGNORE sub directories. I only want to move stuff based on the Parent directory name inside the path given to rclone

Example of Directory structure would be this:

remoteA:/Incoming/Ready/Ash.vs.Evil.Dead.S01.1080p.AMZN.WEBRip
remoteA:/Incoming/Ready/American Horror Story Season 8 Complete 720p HDTV x264
remoteA:/Incoming/Ready/Atypical (2017) Season 1 S01
remoteA:/Incoming/Ready/Altered Carbon (2018) Season 1 S01
remoteA:/Incoming/Ready/Altered Carbon (2018) Season 2 S02
remoteA:/Incoming/Ready/Alfred.Hitchcock.Presents.Season.1

It only looks at Directories inside remoteA:/Incoming/Ready/, NOT sub Directories of the Parent Directories

Hope this explains it better

my example is very simple, and easy to understand.

using the second rclone tree output, edit it to, to show the exact output you want?

Little confused here, tree does not move things.

so here is better explanation

If I run this command
rclone lsd remoteA:/Incoming/Ready/

That is going to give me a list of Directories inside that path, not a tree

This is what I am after I want to Move Directories that this command see's, not a tree view.

rclone lsd remoteA:/Incoming/Ready/

based on key words inside those Directories

so something like what I posted above:

rclone move remoteA:/Incoming/Ready/*.S0*/ remoteA:/TV.Series/
rclone move remoteA:/Incoming/Ready/* Season */ rclone remoteA:/TV.Series/
rclone move remoteA:/Incoming/Ready/*.Season.*/ rclone remoteA:/TV.Series/

Here is actual command I tried as an example

rclone --dry-run move HH-TV-Alpha:/TV.A/.S0/ HH-TV-Alpha:/Season

2022/01/24 08:22:25 NOTICE: Google drive root 'Season': Skipped server side directory move as --dry-run is set

rclone filters work on a set of source dir/files.
rclone move takes a set of source dirs/files and move them.
so all we need to know is the set of filtered source dirs/files for rclone move to use.
there is no need to actually move anything.

filters are very confusing and hard to explain/visualize,
that is why we often create a simple minimalist set of dirs/files and work with that.

here in the forum, often we use rclone tree, rclone ls, and rclone lsd.
to visualize the exact set of source dirs/files that another rclone commands such as rclone move will use.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.