T
T
tigra2018-05-11 14:45:30
linux
tigra, 2018-05-11 14:45:30

How to upload files without directories in rclone?


5af5816cafa06881105807.png
there is such a hierarchy

rclone sync -v /var/www/project/common/uploads/items {username}:{bucket}

the cloud gets objects with a subfolder i.e. the name is not 0a9eff4fcf6c223f93b68ce7f6bfa84e1.jpg as I need, but
0a/0a9eff4fcf6c223f93b68ce7f6bfa84e1.jpg .
How to make directories not get into the name? or if that's not possible, how to upload files with full paths? so that the name is uploads/items/0a/0a9eff4fcf6c223f93b68ce7f6bfa84e1.jpg

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Eugene, 2018-05-12
@tigroid3

The simplest is full paths.
Tip the root directory (parent for /uploads) and use the include or exclude flags to limit the synchronization scope to specific folders where the files are located.
With "only filenames" there is no easy path, because when synchronizing, rklon simply converts the path of the file relative to the current directory into the name of the object in the cloud storage.
An option is to write a script that will pick specific files, but then it will be easier to drop a specific file using the api of a specific cloud. (for aws, for example, via awscli) with a specific object name.
Don't forget that rclone is not a file upload tool, but rather a sync tool .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question