Rclone lsf includ rules

What is the problem you are having with rclone?

I want to get xxxxxx-xxx.mp4 files,so i used "--include '**/[0-9]{6}-[0-9]{3}.{mp4,mkv,avi,rmvb,rm,mpg,mpeg,wmv,flv,ts}',But didn't get what i wanted!

File structure:
| |-- folder2
| | |--111111-111.mp4
| |-- folder3
| | |--folder4
| | | |--222222-222.mkv
| |-- 333333-333.wmv
| |-- test.txt
| |-- test.log

i want ls this:

What is your rclone version (output from rclone version)


Which OS you are using and how many bits (eg Windows 7, 64 bit)

debian10 64

Which cloud storage system are you using? (eg Google Drive)

google drive

The command you were trying to run (eg rclone copy /tmp remote:tmp)

rclone lsf remote: --include '**/[0-9]{6}\-[0-9]{3}**.*' -R --checkers=64 -vv

The rclone config contents with secrets removed.

Paste config here

A log from the command with the -vv flag

2021/01/27 17:29:21 DEBUG : 011819-842-C.mp4: Excluded

I tried it, and the following 2 commands can achieve the goal:
1.--include '**[0-9]{?}-[0-9]{?}*.*'
2.--include '[0-9][0-9][0-9][0-9][0-9][0-9]-[0-9]{?}*.*'
But how can the rule specify the number of digits?
Moreover, if want to get all the files starting with 6 digits in the root directory and subdirectories, must be use --include '**^[0-9]{?}-[0-9]{?}*.*? but That is not valid

The rclone filters are globs not regexp - you can't use regexp syntax here.

Note that {?} isn't doing what you think it is! It is matching a single character - the ?

You have to repeat the digits specifier

--include '[0-6][0-6][0-6][0-6][0-6][0-6]*'

Should do it

This will find files anywhere in the file heirachy which start with 6 digits

You can also use

--include '[\d][\d][\d][\d][\d][\d]*'

Thanks for your reply, I think through your reply, I know how to set the filter.
In addition, in rclone 1.54, rclone move --flatten can be flat move without preserving dirs?if it's true,That would be an amazing feature
or maybe need rclone lsf remote: --files-only --format "p" -R | xargs -t -n1 -I {} rclone move remote:{} remote: --delete-empty-src-dirs ?

We haven't implemented --flatten yet

Yes that would work I think...

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