You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As I use rclone more and more, I've noticed the requirement around source directory copying...and frankly, it really should be changed to resemble how rsync actually works.
This means that copy supercooldir hubic_remote:cake should copy the directory supercooldir into the cake bucket, not the contents. However, copy supercooldir/ hubic_remote:cake should actually copy the contents of supercooldir into the cake bucket.
From the rsync man page:
A trailing / on a source name means "copy the contents of this directory". Without a trailing slash it means "copy the directory".
I'm not sure if there's been any discussion on this already so forgive me if this has already been proposed.
Reacted by Hraban, Mario, ttarchala, Scott Edlund and York-Simon Johannsen
Then you just deleted all the files in your backup and re-uploaded them :-(
I made rclone so that the trailing slash is irrelevant like it is in the rest of the unix world and it always refers to the directory contents.
I did write this in the docs to address this point for new users
If you are familiar with rsync, rclone always works as if you had
written a trailing / - meaning "copy the contents of this directory".
This applies to all commands and whether you are talking about the
source or destination.
I think, practically speaking, it is too late to change it, even if I wanted to :-(
I made rclone so that the trailing slash is irrelevant like it is in the rest of the unix world and it always refers to the directory contents.
Isn't it the exact contrary? cp -r directory dest will copy the directory itself, not just its content.
IMHO it would be better if it was that way in rclone. As for copying only the content of the directory you could either implement rsync's trailing slashway , or the '*' wildcard if you think it is too much error prone (or maybe both).
@ncw Awesome, thanks.
But don't you think that from the user point of view it will start to get confusing?
There would be 5 somewhat similar commands: copymovesynccpmv
I still think having one (and only one) command named copy or cp that would copy the directory itself, but could copy the files with a * wildcard would be better. At least less confusing for the users.
Another solution would be having only one command (sync or rsync) that would behave like cp with no flags, like mv with the --remove-source-files flag, and like rsync itself with some additional flags. However imho it would be harder for users that have no knowledge of how rsync works.
So I'm having some trouble with this. I'm using a Backblaze bucket "b2:mybucket" and I ran rclone sync /data/Media/Photos/2018/ b2:mybucket and ended up with my bucket containing
Bucket
--March
--April
--May
instead of
Bucket
--2018
----March
----April
----May
How do I make it do what I want, without copying over my whole Photos directory? I'm trying to back up my photos by year from most recent to least recent, so eventually I'll have
rclone copy b2:mybucket . --include "myfile*"
Should do it.
Thanks @ncw this does copy the file, but this also copies all the directories underneath that path without the files.
rclone v1.46
- os/arch: linux/amd64
- go version: go1.11.5
--- start filters ---
--- File filter rules ---
+ (^|/)myfile[^/]*$
- ^.*$
--- Directory filter rules ---
+ ^.*$
- ^.*$
--- end filters ---
2019/03/11 17:34:25 NOTICE: myfile_superneat: Not copying as --dry-run
2019/03/11 17:34:26 NOTICE: blah: Not making directory as dry run is set
2019/03/11 17:34:26 NOTICE: blah2: Not making directory as dry run is set
etc...
Activity
ncw commentedon Jul 15, 2016
Sorry I missed this ticket!
Yes there has been some discussion on this.
I'm of the opinion that rsync's way of doing it, while clever, is extremely error prone and a mis-feature.
If you type
Then one say with a bit of command line completion help, type
Then you just deleted all the files in your backup and re-uploaded them :-(
I made rclone so that the trailing slash is irrelevant like it is in the rest of the unix world and it always refers to the directory contents.
I did write this in the docs to address this point for new users
I think, practically speaking, it is too late to change it, even if I wanted to :-(
jody-frankowski commentedon Oct 20, 2016
Isn't it the exact contrary?
cp -r directory destwill copy the directory itself, not just its content.IMHO it would be better if it was that way in rclone. As for copying only the content of the directory you could either implement rsync's trailing slashway , or the '*' wildcard if you think it is too much error prone (or maybe both).
ncw commentedon Nov 3, 2016
@jody-frankowski I'm going to fix this with two new commands
cpandmvwhich will work exactly like their unix counterparts unlikecopyandmovejody-frankowski commentedon Nov 4, 2016
@ncw Awesome, thanks.
But don't you think that from the user point of view it will start to get confusing?
There would be 5 somewhat similar commands:
copymovesynccpmvI still think having one (and only one) command named
copyorcpthat would copy the directory itself, but could copy the files with a*wildcard would be better. At least less confusing for the users.Another solution would be having only one command (
syncorrsync) that would behave likecpwith no flags, likemvwith the--remove-source-filesflag, and likersyncitself with some additional flags. However imho it would be harder for users that have no knowledge of how rsync works.19wolf commentedon Jul 9, 2018
So I'm having some trouble with this. I'm using a Backblaze bucket "b2:mybucket" and I ran
rclone sync /data/Media/Photos/2018/ b2:mybucketand ended up with my bucket containinginstead of
How do I make it do what I want, without copying over my whole Photos directory? I'm trying to back up my photos by year from most recent to least recent, so eventually I'll have
ncw commentedon Jul 10, 2018
This should do the trick
sedlund commentedon Mar 11, 2019
what is the equivalent for
rsync b2:mybucket/data/myfile* .in rclone?
I've tried copy, copyto, sync, --include, --exclude, --filter etc...
It just seems there are way too many options to do something that should be trivial.
ncw commentedon Mar 11, 2019
Should do it.
sedlund commentedon Mar 11, 2019
Thanks @ncw this does copy the file, but this also copies all the directories underneath that path without the files.
ncw commentedon Mar 11, 2019
You want
--include /myfile*then to just copy files in the root - hopefully that will work :-)animosity022 commentedon May 10, 2020
@InAnimaTe - Is this still an open item or can it be closed out?
InAnimaTe commentedon May 10, 2020
I haven't used rclone in 3 years so probably something that can be closed.