Rclone sync local repo giving errors

I am using Restic on Windows. I am relatively new to CLI apps, so please forgive me if this is a stupid question.

I want to use Restic to back up a folder locally, and then duplicate the Repo on a network share. I have been using Rclone to duplicate the Restic Repo.

My problem: duplicating the repo using rclone sync does not work. Copying the folder using the GUI works, and also using xcopy on Windows command prompt. This may be an rclone problem, but I thought I’d ask here in case someone here has some knowledge of how the Restic file system works which could shed light on what’s going wrong?

Here’s my console dump:

C:\Backups\Restic>restic init -r .\Demo
created restic backend 5d17583f63 at .\Demo

Please note that knowledge of your password is required to access
the repository. Losing your password means that your data is
irrecoverably lost.

C:\Backups\Restic>restic backup -r .\Demo C:\Temp\Personal
scan [C:\Temp\Personal]
scanned 2 directories, 4 files in 0:00
[0:00] 100.00%  0B/s  2.339 MiB / 2.339 MiB  6 / 6 items  0 errors  ETA 0:00
duration: 0:00, 8.80MiB/s
snapshot 21856354 saved

C:\Backups\Restic>restic snapshot -r .\Demo
unknown command "snapshot" for "restic"

Did you mean this?
        snapshots


C:\Backups\Restic>restic snapshots -r .\Demo
ID        Date                 Host        Tags        Directory
----------------------------------------------------------------------
21856354  2018-04-10 13:08:14  LT073082                C:\Temp\Personal

C:\Backups\Restic>rclone sync .\Demo .\Demo-sync

C:\Backups\Restic>restic snapshots -r .\Demo-sync
open \\?\C:\Backups\Restic\Demo-sync\locks\1af91d322925e632b17bdd62089308460b4a6ea4ffd051c4c42f3f316e3b05ce: The system cannot find the path specified.
OpenFile
github.com/restic/restic/internal/backend/local.(*Local).Save
        src/github.com/restic/restic/internal/backend/local/local.go:132
github.com/restic/restic/internal/repository.(*Repository).SaveUnpacked
        src/github.com/restic/restic/internal/repository/repository.go:230
github.com/restic/restic/internal/repository.(*Repository).SaveJSONUnpacked
        src/github.com/restic/restic/internal/repository/repository.go:215
github.com/restic/restic/internal/restic.(*Lock).createLock
        src/github.com/restic/restic/internal/restic/lock.go:173
github.com/restic/restic/internal/restic.newLock
        src/github.com/restic/restic/internal/restic/lock.go:102
github.com/restic/restic/internal/restic.NewLock
        src/github.com/restic/restic/internal/restic/lock.go:63
main.lockRepository
        src/github.com/restic/restic/cmd/restic/lock.go:36
main.lockRepo
        src/github.com/restic/restic/cmd/restic/lock.go:23
main.runSnapshots
        src/github.com/restic/restic/cmd/restic/cmd_snapshots.go:53
main.glob..func18
        src/github.com/restic/restic/cmd/restic/cmd_snapshots.go:22
github.com/restic/restic/vendor/github.com/spf13/cobra.(*Command).execute
        src/github.com/restic/restic/vendor/github.com/spf13/cobra/command.go:650
github.com/restic/restic/vendor/github.com/spf13/cobra.(*Command).ExecuteC
        src/github.com/restic/restic/vendor/github.com/spf13/cobra/command.go:729
github.com/restic/restic/vendor/github.com/spf13/cobra.(*Command).Execute
        src/github.com/restic/restic/vendor/github.com/spf13/cobra/command.go:688
main.main
        src/github.com/restic/restic/cmd/restic/main.go:69
runtime.main
        /usr/local/go/src/runtime/proc.go:185
runtime.goexit
        /usr/local/go/src/runtime/asm_amd64.s:2337

C:\Backups\Restic>

Can you try to provide an absolute path?
restic snapshots -r C:\Backups\Restic\Demo-sync

I found the issue: rclone sync does not copy empty folders. This makes restic give an error because it expects a locks folder in the repository folder, even if it’s empty.

I am going to get around this by doing an initial copy with another tool that does also copy the empty folders, and then doing subsequent updates with rclone.

The rclone sync error is on github here: https://github.com/ncw/rclone/issues/1837

Thanks for the help, though!

FreeFileSync has worked really well for me in the past.

@simeydk which version of restic is that? We have since improved handling of empty directories, they are created on demand. Can you retry with a binary from master? You can find precompiled binaries here: https://beta.restic.net/?sort=time&order=desc

In addition, the following PR will further improve handling non-existing dirs for listing files: https://github.com/restic/restic/pull/1712

I was using v0.7.3 before. I have now downloaded v0.8.3, and I’m not getting a different error:

C:\Users\om90898>restic snapshots -r C:\Backups\restic\demo
password is correct
ID        Date                 Host        Tags        Directory
----------------------------------------------------------------------
f7ac6245  2018-04-11 13:21:59  LT073082                C:\Simey\Documents\Personal
5fde62c6  2018-04-11 13:22:11  LT073082                C:\Simey\Documents\Personal
----------------------------------------------------------------------
2 snapshots

C:\Users\om90898>rclone sync  C:\Backups\restic\demo C:\Backups\restic\sync

C:\Users\om90898>restic snapshots -r C:\Backups\restic\sync
password is correct
List(lock) returned error, retrying after 538.801249ms: GetFileAttributesEx \\?\C:\Backups\restic\sync\locks: The system cannot find the file specified.
List(lock) returned error, retrying after 675.963279ms: GetFileAttributesEx \\?\C:\Backups\restic\sync\locks: The system cannot find the file specified.
List(lock) returned error, retrying after 580.214522ms: GetFileAttributesEx \\?\C:\Backups\restic\sync\locks: The system cannot find the file specified.
List(lock) returned error, retrying after 1.534240401s: GetFileAttributesEx \\?\C:\Backups\restic\sync\locks: The system cannot find the file specified.
List(lock) returned error, retrying after 3.011080038s: GetFileAttributesEx \\?\C:\Backups\restic\sync\locks: The system cannot find the file specified.
List(lock) returned error, retrying after 4.990444048s: GetFileAttributesEx \\?\C:\Backups\restic\sync\locks: The system cannot find the file specified.
List(lock) returned error, retrying after 8.069329228s: GetFileAttributesEx \\?\C:\Backups\restic\sync\locks: The system cannot find the file specified.
List(lock) returned error, retrying after 5.499844466s: GetFileAttributesEx \\?\C:\Backups\restic\sync\locks: The system cannot find the file specified.
signal interrupt received, cleaning up

Ah, that’s precisely what the recent PR will improve. If you have a little more patience (one or two minutes), restic will continue on its own.