What is the problem you are having with rclone?
I am trying to transfer files between Google Drive and S3 that match a certain file name pattern (I am using the --include flag). I only want to files to be transferred into the root folder of my S3 bucket and the directory folders from Google Drive to be ignored
Run the command 'rclone version' and share the full output of the command.
- os/kernel: 21.6.0 (arm64)
- os/type: darwin
- os/arch: arm64
- go/version: go1.19.3
- go/linking: dynamic
- go/tags: none
Are you on the latest version of rclone? You can validate by checking the version listed here: Rclone downloads
-->
Yes
Which cloud storage system are you using? (eg Google Drive)
Google Drive and AWS S3
The command you were trying to run (eg rclone copy /tmp remote:tmp
)
rclone copy -P gdrive:RecTest s3:bucket --include "Copy*"
Ole
(Ole Frost)
December 14, 2022, 7:11pm
2
Hi Mark,
Sorry, that is not possible yet, it has been a wish for a while:
opened 12:34PM - 22 Nov 18 UTC
IMPORTANT
help wanted
new feature
#### What is your current rclone version (output from `rclone version`)?
v1.43.… 1
#### What problem are you are trying to solve?
flat copy or sync from a remote (without preserving the tree structure)
[equivalent with local files](https://unix.stackexchange.com/questions/52814/flattening-a-nested-directory)
#### How do you think rclone should be changed to solve that?
Add a ‘--flatten’ switch to the sync and copy comnands.
Perhaps you can copy the files to a local folder, flatten them something like shown in this post and then copy to the target - or use some of the other ideas in the same thread.
asdffdsa
(jojothehumanmonkey)
December 14, 2022, 7:35pm
3
hi,
this should work
source=gdrive:RecTest
dest=s3:bucket
rclone lsf $source --include="Copy*" --files-only --recursive --absolute | xargs -I file rclone copy "$source/file" "$dest" -v --dry-run
that will create a set of source files, and pass it to xargs
1 Like
Thanks @asdffdsa - is there a way to pass this list to an rclone copy command?
asdffdsa
(jojothehumanmonkey)
December 15, 2022, 1:45pm
5
in your specific case, the answer is no, as rclone does not have a --flatten
flag.
lol, can try --magic
in general, the answer is yes, with something like this
rclone lsf $source.... > files.lst
rclone copy $source $dest --include-from=files.lst
system
(system)
Closed
January 14, 2023, 1:46pm
6
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.