Path Wildcard Doesn't work with --files-from or --files-from-raw

What is the problem you are having with rclone?

Using a Path Wildcard (/**) with --files-from or --files-from-raw does not work. From what I understand --files-from should support this as mentioned here.

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: 6.2.0-37-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 --files-from test1.txt music:/Media /mnt/hdd/disk2/ -vv

Contents of test1.txt

/Music/test1/**

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

[music]
type = drive
client_id = xx
client_secret = xx
scope = drive.readonly
token = xx
team_drive = xx
root_folder_id = 

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

$ rclone copy --files-from test1.txt music:/Media /mnt/hdd/disk2/ -vv
2023/12/01 20:33:02 DEBUG : rclone: Version "v1.65.0" starting with parameters ["rclone" "copy" "--files-from" "test1.txt" "music:/Media" "/mnt/hdd/disk2" "-vv"]
2023/12/01 20:33:02 DEBUG : Creating backend with remote "music:/Media"
2023/12/01 20:33:02 DEBUG : Using config file from "/home/user/.config/rclone/rclone.conf"
2023/12/01 20:33:03 DEBUG : fs cache: renaming cache item "music:/Media" to be canonical "music:Media"
2023/12/01 20:33:03 DEBUG : Creating backend with remote "/mnt/hdd/disk2"
2023/12/01 20:33:03 DEBUG : fs cache: renaming cache item "/mnt/hdd/disk2" to be canonical "/mnt/hdd/disk2"
2023/12/01 20:33:03 DEBUG : Media: Excluded
2023/12/01 20:33:03 DEBUG : lost+found: Excluded
2023/12/01 20:33:03 DEBUG : Music/test1/testing.txt: Excluded
2023/12/01 20:33:03 DEBUG : Local file system at /mnt/hdd/disk2: Waiting for checks to finish
2023/12/01 20:33:03 DEBUG : Local file system at /mnt/hdd/disk2: Waiting for transfers to finish
2023/12/01 20:33:03 INFO  : There was nothing to transfer
2023/12/01 20:33:03 INFO  :
Transferred:              0 B / 0 B, -, 0 B/s, ETA -
Elapsed time:         1.3s

When running the same command but adding the file to the path, the copy works as expected.
Contents of test1.txt with added file name.

/Music/test1/testing.txt

As per docs:

--files-from - Read list of source-file names

Adds path/files to an rclone command from a list in a named file.

"path/files" - not wildcard patterns.

To achieve what you want you should use either --filter-from or --include-fron

For example for --filter-from filters.txt the content of the filters.txt should be:

+ /Music/test1/**
- *

It will include all content of /Music/test1/ directory (+ /Music/test1/**) and exclude everything else (- *)

Thank you @kapitainsky! That worked perfectly.

1 Like

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