Rclone bisync erases onedrive remote, even the RCLONE_TEST file

Rclone bisync does not work with onedrive and erase data on remote, even the RCLONE_TEST file used for access control

What is the problem you are having with rclone?

Run the command 'rclone version' and share the full output of the command.

maiko@maiko-rpi:/media/FILES/mkdrive$ rclone version
rclone v1.73.2
- os/version: raspbian 13.4 (64 bit)
- os/kernel: 6.12.62+rpt-rpi-2712 (aarch64)
- os/type: linux
- os/arch: arm64 (ARMv8 compatible)
- go/version: go1.25.8
- go/linking: static
- go/tags: none

Which cloud storage system are you using? (eg Google Drive)

The command you were trying to run (eg rclone copy /tmp remote:tmp)

```
/usr/bin/rclone bisync /media/FILES/mkdrive/oned/notvault oned:notvault     --check-access --recover --resilient --max-delete 50 --delete-excluded --links --max-lock 2m  --compare size,modtime,checksum --exclude "Cofre Pessoal/**" --exclude "Personal Vault/**" --log-level DEBUG 
```

The rclone config contents with secrets removed.

```
{
    "dbox": {
        "token": "",
        "type": "dropbox"
    },
    "gdrive": {
        "client_id": "",
        "client_secret": "",
        "scope": "drive",
        "team_drive": "",
        "token": "",
        "type": "drive"
    },
    "mega": {
        "master_key": "",
        "pass": "",
        "session_id": "",
        "type": "mega",
        "user": ""
    },
    "oned": {
        "drive_id": "",
        "drive_type": "personal",
        "token": "",
        "type": "onedrive"
    }
}
```

A log from the command with the -vv flag

To summarize, I show both local and remote folder contents.
Re-create the RCLONE_TEST, rclone bisync  --resync, 
show the folder contents again, created the t7.txt locally, 
then rclone bisync, then  it erased my remote folder.

https://pastebin.com/XPYqBg5P

--delete-excluded deletes all files that are excluded. It is almost certainly not what you want here.

I don´t think that is the case because at the end I want to have files excluded on remote when they are locally. But to be sure I re-ran without it, and got the same results: maiko@maiko-rpi:~$ cd /media/FILES/mkdrive/maiko@maiko-rpi:/media/FILES/mkdriv - Pastebin.com

One thing that is weird to me about this log is that I see where you create t8.txt on the local side:

maiko@maiko-rpi:/media/FILES/mkdrive$ touch oned/notvault/t8.txt

And I see it exists on the remote side at the end:

maiko@maiko-rpi:/media/FILES/mkdrive$ rclone ls oned:notvault
        0 t8.txt

but I don't see anything in the middle showing a transfer of t8.txt from local to remote.

Is it possible that you have another instance of rclone syncing the same directory at the same time? Perhaps your previous --delete-excluded command was still running from a cron job in the background while you did your test? Because otherwise, there should be a log here showing how t8.txt got transferred.

Further, the behavior here is consistent with what I'd expect for --delete-excluded. The one file that needed to be copied ( t8.txt) is the only one that exists at the end -- everything else was excluded, and thus deleted. (Which there is also no log for, and there should have been.)

If you don't think there could have been a competing process, let's simplify and try to reproduce this with a more minimal test, to eliminate some red herrings. Create a new test directory that you haven't used before. Use only full absolute paths for your commands instead of cd with relative paths. Be consistent about using or omitting the trailing slash. And use rclone touch and rclone lsl instead of the default touch and ls, so we can see exactly what rclone sees. Omit --links for now. If you can still reproduce the issue, we'll know those variables were irrelevant. If not, we can try adding them back one at a time to see which one is responsible.

I think I covered all the bases now, even put a flock for locking and showed that no other rclone is running: # maiko @ maiko-rpi in /media/FILES/mkdrive [18:13:32] - Pastebin.com

I did as you suggested too, without –links and fewer params and it worked.

maiko @ maiko-rpi in /media/FILES/mkdrive [18:27:12]

$ ls -R oned
oned:
notvault  RCLONE_TEST

oned/notvault:
r9.txt  RCLONE_TEST  t10.txt  t11.txt  t6.txt  t7.txt  t8.txt  test_fewer_params.txt  todo.txt

maiko @ maiko-rpi in /media/FILES/mkdrive [18:27:21]

$ rclone lsl oned:notvault
0 2026-03-21 20:29:24.000000000 RCLONE_TEST
0 2026-03-23 18:05:25.000000000 r9.txt
0 2026-03-23 18:10:56.000000000 t10.txt
0 2026-03-23 18:15:54.000000000 t11.txt
0 2026-03-22 17:27:30.000000000 t6.txt
0 2026-03-22 17:33:28.000000000 t7.txt
0 2026-03-22 21:23:09.000000000 t8.txt
1654 2026-03-21 20:32:09.000000000 todo.txt

maiko @ maiko-rpi in /media/FILES/mkdrive [18:27:28]

$ /usr/bin/flock -n /tmp/rclone-bisync-oned.lock     /usr/bin/rclone bisync /media/FILES/mkdrive/oned/notvault oned:notvault     --check-access --recover --resilient --max-delete 50 --max-lock 2m  --compare size,modtime,checksum  --log-level DEBUG &> rclone.txt

This one was using --delete-excluded, though.

$ /usr/bin/flock -n /tmp/rclone-bisync-oned.lock     /usr/bin/rclone bisync /media/FILES/mkdrive/oned/notvault oned:notvault     --check-access --recover --resilient --max-delete 50 --links --max-lock 2m  --compare size,modtime,checksum     --exclude "Cofre Pessoal/**" --exclude "Personal Vault/**" --delete-excluded --log-level INFO

Great. Now it shouldn't be too hard to identify the cause, by adding them back one at a time, and seeing which one breaks it.