Is is possible to allow overlapping with --backup-dir when filtering or including?

I 100% understand why the following doesn't work:

$ rclone sync --backup-dir=B:backups A: B:

That makes sense.

But what about either of the following:

$ rclone sync --filter "- /backups/" --backup-dir=B:backups A: B:

or

$ rclone sync --files-from "list-of-files-without-anything-in-backups" --backup-dir=B:backups A: B:

In both of the cases, the overlap is excluded by the filtering. Is there any flag that tells rclone to try anyway? Or is it possible to allow this?

It might be super early for me to actually think as that seems a little wonky to implement something that would be logically a bit confusing.

Wouldn't it be easier to just make two folders on the remote and store all your data in remote:data and sync remote:data and have a backup folder with remote:backup? I might need more caffeine though.

Easier? Sure! But who wants easy!?!

I am trying to avoid something like that since it breaks with everything else I am doing. But that’s my problem.

Since I have the list of files I can just do an rclone moveto with flags to try to speed it up. Certainly less efficient but not the end of the world.

One idea though if this was something worth doing is to make it so that while they can overlap, you can’t backup into the backup. So a backup-dir flag is also an implicit filter. In some ways that makes more sense! Just a thought.

Thanks!

I didn't understand what you're trying to "speed up". I guess I don't understand.

Can you share your use case and what it breaks?

Yes, rclone isn't clever enough to notice that.

There could be I guess...

I guess rclone could auto add a filter rule if it detects the destination and the backupdir overlap.

I think rsync does that for you.

Or rclone could see if the backup-dir was excluded if it detected an overlap and continue if it was OK.

Do you fancy working on one of these @jwink3101 ?

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