Platform: W10.
I'm using rsync in WSL to (in principle) mirror the contents on one external hard drive (F:) to another (H:). Both are formatted NTFS.
I start (as root in WSL) just by rsyncing the contents of F:\Backups:
rsync -rtivlH --delete-before --exclude "Disk images/M17A/Macrium" "/mnt/f/Backups/" "/mnt/h/Backups/"
Some obscure errors are reported... but nothing which corresponds to the file said to be missing later. At the same time, I notice that one or two directories on the destination drive not present on the source drive have not been deleted. Why might this happen?
Then I try a restic backup from the destination drive:
C:\Users\Mike>restic -r "H:\Backups\restic\My documents" --verbose --json -p "D:\My documents\sysadmin\resources\restic\my_documents_pwd.txt" restore 54da95b0 --target "D:\temp\restore2022-01-14"
found 3 old cache directories in C:\Users\Mike\AppData\Local\restic, run `restic cache --cleanup` to remove them
restoring <Snapshot 54da95b0 of [D:\My documents] at 2021-11-23 16:57:49.9549335 +0000 UTC by M17A\Mike@M17A> to D:\temp\restore2022-01-14
ignoring error for \: id 15eb231f10fba940a0c49b9362d2df7b49db5132dc5ed426bd879a4de6640147 not found in repository
ignoring error for \: id 15eb231f10fba940a0c49b9362d2df7b49db5132dc5ed426bd879a4de6640147 not found in repository
Fatal: There were 2 errors
This file was not mentioned in the report on the errors.
I run the same rsync
command as above again, only this time I omit the --delete-before
switch. No errors reported.
I run the same restic restore
command as above... it works. The snapshot is restored.
This is a bit of a dilemma: on the one hand it appears that --delete-before
is causing problems. On the other I don't want the destination drive to have anything other than a perfect mirror of what is on the source drive. But equally I don't want to have to delete the whole of the destination drive and have to copy the whole contents of the source drive.
Ideally, whatever the explanation for the failure(s), if such it/they be, I'd like somehow to delete completely all files and directories in the target drive which are just not present on the source drive, in stage 1, and then run the rsync
command without the seemingly problematic --delete-before
switch in stage 2.
Is there any way to do this? Can anyone offer any insight into the problem here, and possible solutions?