Failed to sync: source and parameter to --backup-dir mustn't overlap

What does this error message mean: “source and parameter to --backup-dir mustn’t overlap”?

source is “/”.
–backup-dir=/run/media/wolfv/big_stick/backup_wolfv/old_files

From this command and output:

$ rclone sync / /run/media/wolfv/big_stick/backup_wolfv/last_snapshot --backup-dir=/run/media/wolfv/big_stick/backup_wolfv/old_files --suffix=_2018-06-25_02:10:05 --filter-from=/DATA/Documents/pc_maintenance/backup_systems/rclone_wolf/filter_rules --checksum --log-level=DEBUG --dry-run

2018/06/25 02:28:05 DEBUG : rclone: Version “v1.41” starting with parameters [“rclone” “sync” “/” “/run/media/wolfv/big_stick/backup_wolfv/last_snapshot” “–backup-dir=/run/media/wolfv/big_stick/backup_wolfv/old_files” “–suffix=_2018-06-25_02:10:05” “–filter-from=/DATA/Documents/pc_maintenance/backup_systems/rclone_wolf/filter_rules” “–checksum” “–log-level=DEBUG” “–dry-run”]
2018/06/25 02:28:05 DEBUG : Using config file from “/home/wolfv/.config/rclone/rclone.conf”
2018/06/25 02:28:05 INFO : Local file system at /run/media/wolfv/big_stick/backup_wolfv/last_snapshot: Modify window is 1ns
2018/06/25 02:28:05 ERROR : Fatal error received - not attempting retries
2018/06/25 02:28:05 Failed to sync: source and parameter to --backup-dir mustn’t overlap

You are attempting to sync / to /run/media/wolfv... but you can find the latter path under / so if you sync it like that you’ll make recursive copies of one under the other.

You want to use the -x flag to make sure rclone stays on the single filesystem. Unfortunately you’ll still get the musn’t overlap messages, so you’d need to fool rclone by making another remote. So make a local remote called big_stick pointing to /run/media/wolfv/big_stick/ and you can get it to work.

Thank you for the explanation ncw.
I ended up using two sets of filter_rules and rclone commands.

UPDATE: multiple sets of filter_rules was too much maintenance.

How to make a local remote point to /run/media/wolfv/big_stick/ ?
I entered “rclone config” and selected “13 / Local Disk”.
But there is no option to set path https://rclone.org/commands/rclone_config/

I am on rclone v1.41

Ah, sorry I forgot, you don’t set the path, you enter it each time. So you’d enter local:/run/media/wolfv/big_stick/. You could make an alias for that to save typing.

Thanks ncw.
The following is a more detailed description of the issue.

Here is the filter_rules file, where “.spacemacs” is a file:

+ /home/wolfv/.spacemacs
+ /DATA/**
+ *

Source is / (root)
DATA is a different partition mounted on root.
Destination is a USB drive mounted on root.
I created a local remote named “local”, and put the USB drive on it:

 local:/run/media/wolfv/big_stick/wolfv_backup

I added --one-file-system to the rclone command but still get the same “–backup-dir mustn’t overlap” error:

$ rclone sync / /run/media/wolfv/big_stick/wolfv_backup/last_snapshot --backup-dir=local:/run/media/wolfv/big_stick/wolfv_backup/old_files --suffix=_2018-06-28_09:17:59 --filter-from=/DATA/Documents/pc_maintenance/backup_systems/rclone_wolf/filter_rules --log-level=DEBUG --one-file-system --dry-run
2018/06/28 10:53:52 DEBUG : rclone: Version "v1.41" starting with parameters ["rclone" "sync" "/" "/run/media/wolfv/big_stick/wolfv_backup/last_snapshot" "--backup-dir=local:/run/media/wolfv/big_stick/wolfv_backup/old_files" "--suffix=_2018-06-28_09:17:59" "--filter-from=/DATA/Documents/pc_maintenance/backup_systems/rclone_wolf/filter_rules" "--log-level=DEBUG" "--one-file-system" "--dry-run"]
2018/06/28 10:53:52 DEBUG : Using config file from "/home/wolfv/.config/rclone/rclone.conf"
2018/06/28 10:53:52 INFO  : Local file system at /run/media/wolfv/big_stick/wolfv_backup/last_snapshot: Modify window is 1ns
2018/06/28 10:53:52 ERROR : Fatal error received - not attempting retries
2018/06/28 10:53:52 Failed to sync: source and parameter to --backup-dir mustn't overlap

This is similar to Sync two partitions with one rclone command? but with the addition of --one-file-system and --backup-dir=local:/run/media/wolfv/big_stick/wolfv_backup/old_files
(I apologize for double posting, I originally thought they were two separate issues).

Once the “–backup-dir mustn’t overlap” error is resolved, there is still the matter of --one-file-system flag:
--one-file-system is needed to fix “–backup-dir mustn’t overlap” error.
--one-file-system breaks access to the /DATA partition, as it did in Sync two partitions with one rclone command?
Do you see a way out of this conundrum?

Rename your local remote to say localdisk - I’ve realised calling it local is the name it normally gets so the workaround isn’t working!

Then your sync should work with or without --one-file-system.

I think what I should do is make the test for overlapping directories test to see whether the --backup-dir is excluded - then you wouldn’t have to mess about with making a different named remote to fool it.

ncw:

That worked!
I used local remote “local_drive:” on both destination and --backup-dir.
And removed --one-file-system as you suggested.

This is the rclone command:

rclone sync / local_drive:/run/media/wolfv/big_stick/wolfv_backup/last_snapshot --backup-dir=local_drive:/run/media/wolfv/big_stick/wolfv_backup/archive --suffix=_2018-06-30_07:29:42 --log-file=/DATA/Documents/pc_maintenance/backup_systems/rclone_wolf/rclone_jobber.log --filter-from=/DATA/Documents/pc_maintenance/backup_systems/rclone_wolf/filter_rules --checksum --log-level=ERROR

Very nice. Thank you for your help.

Glad you got it working. I’ve put on the TODO list to think about rclone being a bit more clever here!