Unable to backup multiple directories in Windows 10

Hey

New to using restic, however I have read through the help page via the terminal, but I think I am misunderstanding the syntax.

I am ultimately trying to backup multiple drives, but I have tested trying to back up 2 and cannot seem to do so

Command I am using when backing up one drive works fine:

restic -r A:\restic_backup\ backup --use-fs-snapshot "C:\Users\Mr Slick\Documents" --exclude-file="C:\Restic\exclude.txt"

Command when I am trying to backup 2 different paths:

restic -r A:\restic_backup\ backup --use-fs-snapshot "D:\SSD VST" "K:\Davinci Resolve Stuff\" --exclude-file="C:\Restic\exclude.txt"

Error received is:

enter password for repository:
repository bf5022d1 opened (version 2, compression level auto)
no parent snapshot found, will read all files
creating VSS snapshot for [d:\]
successfully created snapshot for [d:\]
creating VSS snapshot for [k:\]
successfully created snapshot for [k:\]
error: no result
error: no result
error: no result
error: no result
Fatal: unable to save snapshot: CreateFile \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy19\Davinci Resolve Stuff" --exclude-file=C:: The filename, directory name, or volume label syntax is incorrect.

I am assuming that I am using the incorrect syntax when adding an additional path?

I have tried with different quotations, tried without quotations, with brackets etc. but after trying multiple ways of trying the command I’m sure I must be missing something completely

[Edit] - I am using version 0.15.2

Thanks in advance

Try restic -r repo backup --flags --more-flags /dir1 /dir2

As per the syntax of the command, see restic help backup:

Usage:
  restic backup [flags] [FILE/DIR] ...

Thanks @zer0 this looks like this has worked, also I think the trailing \ after the directory was causing an issue too

1 Like

I was following a tutorial, which probably explains why I was a bit confused; - Backup With Restic for Windows - YouTube

However, testing it today, looks like it’s working so far which is great

Thanks though

The problem is the last backslash in "K:\Davinci Resolve Stuff\". This leads to inconsistent escaping on Windows, see Problem with trailing slash and spaces in repository directory on Windows · Issue #2449 · restic/restic · GitHub and [issue 2449] fix problems with trailing slash... by winks · Pull Request #3637 · restic/restic · GitHub . From what I can tell this problem cannot be solved within restic .

1 Like

I will definitely keep that in mind,

I have tested this out a bit now and I can see that backing up my drives seem to work when I run it manually from the terminal with those backslashes, but I think the backslash seems to become an issue when I run the same command as a cmd script. It will recognise the first and the last drives but not the 2 in the middle…