Copy certain "folder/files" with --include-from

What is the problem you are having with rclone?

I need to copy a bunch of selected folders with its files/contents from remotecrypt to "normal" remote.
I put those folders in a txt to pass it as an --include-from parameter but can't get it work.

Here is the content of "folder_batch.txt" with an example of two folders I want to copy:
30 Birthday [DVDRIP][Ac3 5.1]
Wedding [BDRip][AC3 5.1-Decoded+more][ES-EN]

Every folder contains one or more files inside.

Run the command 'rclone version' and share the full output of the command.

rclone v1.65.0

  • os/version: ubuntu 22.04 (64 bit)
  • os/kernel: 5.15.0-89-generic (x86_64)
  • os/type: linux
  • os/arch: amd64
  • go/version: go1.21.4
  • go/linking: static
  • go/tags: none

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 copy --include-from=folder_batch.txt "remotecrypt:media/Family" "remotenew:media/Family" -P -vvv --dry-run

Please run 'rclone config redacted' and share the full output. If you get command not found, please make sure to update rclone.

[remote]
type = drive
client_id = XXX
client_secret = XXX
token = XXX
team_drive =


[remotecrypt]
type = crypt
remote = remote:foldercrypt
filename_encryption = standard
directory_name_encryption = true
password = XXX
password2 = XXX

[remotenew]
type = drive
client_id = XXX
client_secret = XXX
token = XXX
team_drive =

A log from the command that you were trying to run with the -vv flag

 Failed to load filters: bad glob pattern "Wedding [BDRip][AC3 5.1-Decoded+more][ES-EN]" (regexp "(^|/)Wedding [BDRip][AC3 5.1-Decoded+more][ES-EN]$"): error parsing regexp: invalid character class range: `S-E`

[ is special character, needs to be escaped.

rclone ls .
        0 Wedding [BDRip][AC3 5.1-Decoded+more][ES-EN]
        0 file.ext
rclone ls . --include='Wedding \[BDRip\]\[AC3 5.1-Decoded+more\]\[ES-EN\]'
        0 Wedding [BDRip][AC3 5.1-Decoded+more][ES-EN]

Thank you, is there any automation to put escape character to every folder? or something like --files-from-raw for folders?

fwiw, that is documented at \ characters escape the [ and ] so an rclone filter treats them literally

with rclone, not that i know of.
tho, create a bash one-liner using sed or whatnot to pre-process the file before feeding it to rclone.

Oops, sorry didn't read that documented part.
Ok!! thank you, If it's just a matter of escaping the parentheses and there are no more special characters it will be easy to find a way to do it. :partying_face:

@asdffdsa no more special characters errors but do you know why is giving an "excluded" message for every folder? and nothing is being uploaded. Thanks again!

yes, that is debug output.
for a given root folder, rclone has to list all the subfolders and then decided what to filter.

also, now, i better understand that you want to filter on the names of folders, not files.
and for that, check out https://rclone.org/filtering/#directory_filter

Well, I want to copy all folders in that list (batch.txt) with all their subfolders and files from "remotecrypt" to the new remote "remotenew". Maybe I need to add an Slash and * for every entry?

30 Birthday [DVDRIP][Ac3 5.1]/*
Wedding [BDRip][AC3 5.1-Decoded+more][ES-EN]/*

Here's an example of what I need:

remotecrypt:media/Family/30 Birthday [DVDRIP][Ac3 5.1]/file1.rar (and more subfolders and rars files) ------copy to-----> remotenew:media/Family/30 Birthday [DVDRIP][Ac3 5.1]/file1.rar (and more subfolders and rars)

Thanks, I'm reading directory filtering atm.

maybe *, maybe **.

filters are crazy complex, the docs are complex and each case is very different.

so i just play around with rclone ls and rclone tree, read the docs, and fumble along to a solution.

Yes! and I'm going crazy too reading the docs.
I think I'll go to sleep and tomorrow I'll reread it with new eyes to try to figure It out.

Thank you very much for your help!

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