Sonic3R
(Sonic)
January 25, 2023, 11:16am
1
What is the problem you are having with rclone?
I have a list of files that I need to copied, those files are spread in several folders.
Run the command 'rclone version' and share the full output of the command.
rclone v1.60.0
- os/version: Microsoft Windows Server 2019 Datacenter 1809 (64 bit)
- os/kernel: 10.0.17763.3887 (x86_64)
- os/type: windows
- os/arch: amd64
- go/version: go1.19.2
- go/linking: static
- go/tags: cmount
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.exe copy my-gdrive:dir ".\tmp" --config="pathto\rclone.conf" --include-from path\files.txt
and the files.txt
+ **MY_FILE1*
+ **MY_FILE2*
+ **MY_FILE3*
- **
The rclone config contents with secrets removed.
[my-gdrive]
type = drive
scope = drive
service_account_file = path\rclone1.json
team_drive = XXXXXXXXXXXXX
My folder structure
dir
|_ dir2
|_ MY_FILE1{{sda}}.txt
|_dir3
|_ MY_FILE2.txt
|_dir4
|_ MY_FILE1.txt
I want to copy MY_FILE1* from dir2 and dir4, but I see in logs that those are excluded.
What is wrong with my filter ?
What do you want to happen? I match everything in my test in your example.
[felix@gemini test]$ rclone ls /home/felix/test
0 dir4/MY_FILE1.txt
0 dir3/MY_FILE2.txt
0 dir2/MY_FILE1{{sda}}.txt
[felix@gemini test]$ rclone ls /home/felix/test --filter-from /home/felix/filter -vv
2023/01/25 07:01:33 DEBUG : Setting --config "/opt/rclone/rclone.conf" from environment variable RCLONE_CONFIG="/opt/rclone/rclone.conf"
2023/01/25 07:01:33 DEBUG : rclone: Version "v1.61.1" starting with parameters ["rclone" "ls" "/home/felix/test" "--filter-from" "/home/felix/filter" "-vv"]
2023/01/25 07:01:33 DEBUG : Creating backend with remote "/home/felix/test"
2023/01/25 07:01:33 DEBUG : Using config file from "/opt/rclone/rclone.conf"
0 dir4/MY_FILE1.txt
0 dir2/MY_FILE1{{sda}}.txt
0 dir3/MY_FILE2.txt
2023/01/25 07:01:33 DEBUG : 2 go routines active
[felix@gemini test]$ cat ../filter
+ **MY_FILE1*
+ **MY_FILE2*
+ **MY_FILE3*
- **
Sonic3R
(Sonic)
January 25, 2023, 12:11pm
3
You used filter-from
since I used include-from
, that why is worked for you
That's because you've used the filter from syntax which is why I used it
Include from looks like this:
--include-from - Read include patterns from file
Adds path/file names to an rclone command based on rules in a named file. The file contains a list of remarks and pattern rules.
For an example include-file.txt:
# a sample include rule file
*.jpg
file2.avi
Include from would look like:
[felix@gemini ~]$ rclone ls /home/felix/test --include-from /home/felix/include-from -vv
2023/01/25 07:16:38 DEBUG : Setting --config "/opt/rclone/rclone.conf" from environment variable RCLONE_CONFIG="/opt/rclone/rclone.conf"
2023/01/25 07:16:38 DEBUG : rclone: Version "v1.61.1" starting with parameters ["rclone" "ls" "/home/felix/test" "--include-from" "/home/felix/include-from" "-vv"]
2023/01/25 07:16:38 DEBUG : Creating backend with remote "/home/felix/test"
2023/01/25 07:16:38 DEBUG : Using config file from "/opt/rclone/rclone.conf"
0 dir4/MY_FILE1.txt
0 dir2/MY_FILE1{{sda}}.txt
0 dir3/MY_FILE2.txt
2023/01/25 07:16:38 DEBUG : 2 go routines active
[felix@gemini ~]$ cat include-from
**MY_FILE1*
**MY_FILE2*
**MY_FILE3*
system
(system)
Closed
January 28, 2023, 12:17pm
7
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.