Error: FindFirstFile on backup with file named "aux"

I ran one of my occasional offsite restic backups twice this evening. I got this error on the second run. I don’t know if there was an error on the first run or not as I didn’t look at the console. I know that a lot of data was added to the repository on the first run, so I think it worked ok.

This is with restic 0.9.3 on Windows 10-64.

restic.exe --exclude c:\images\Rejects --exclude c:\images\Prints --exclude “c:\images\Lab Test Prints” --exclude c:\images\Original\200* --exclude c:\images\Original\2010 --exclude c:\images\Original\2011 --exclude c:\images\Original\2012 --exclude c:\images\Original\2013 --exclude c:\images\Original\2014 --exclude c:\images\Original\2015 --exclude c:\images\HomeVideoArchive --repo D:\Restic\Photos backup c:\images

error: FindFirstFile \?\aux: The filename, directory name, or volume label syntax is incorrect.

Files: 0 new, 3 changed, 30157 unmodified
Dirs: 0 new, 1 changed, 0 unmodified
Added to the repo: 595 B

Any thoughts? Is it a problem with my command line, a software bug, some other user error?

Hm, interesting. Can you please run this again with -v -v and paste the lines around that error so we can see which file restic is trying to access? Is there a file called aux in c:\images somewhere?

Yes, there is a file called aux.jpg nested down about four levels. I can’t view, delete, or even look at the properties of this file. So something is screwy on my file system which I need to fix. Sorted - thanks!

1 Like

Please let us know when you find out what’s going on! File systems are weird sometimes…

The answer is “aux” is a reserved dos keyword, files with that name cause problems. Here’s a reference here.

The format to delete the file named aux.jpg was to run this at an administrator command prompt

del \?\D:\path\to\image\aux.jpg


Oh wow! I had no clue about those restrictions. (Why is Windows the worst? Sorry, can’t help but think that’s… a really sad set of limitations.) Thanks for the link… TIL.

I’m still a bit puzzled. The file is called aux.jpg, which is different from the forbidden name aux. And also, restic’s’ error message talks about \?\aux, without a file extension. How did that happen? :confused:

I don’t have an answer sorry. All I know is I tried multiple methods to delete this file, including “del”, “del” as administrator, the same in OS recovery mode, other commands to change permissions, and nothing worked until I used the ?\ filename format.

1 Like

Thanks for the feedback, it’s very odd indeed. If anybody can clear that up, I’d be very interested in the cause for that behavior…

Hi I am facing a similar issue, this time it is with files in the downloads folder and from what I can see, they are not restricted in any way, they are just images I use for work. Not sure what to make of it.I have attached the verbose screenshot from the Windows Powershell.
Thank you.

“The system cannot find the file specified” makes it sound like something else deleted the file in between restic listing the parent directory’s contents, and trying to read the file.

Does this error happen every time you run the backup?

Hi, thanks for your response. The above error happens every time I run the backup. I am able to browse to the folder and view the files but for some reason restic is unable to access it.

Could they be special files, eg. symlinks/junctions, or have extended attributes? I found some issues about these types of files - here and here, but I’m not sure whether they are fully supported by restic.

It looks like this is not a restic issue in my case. For some reason windows thinks that this path does not exist even though I was able to access the folder and the files stored within it.

I was clearing some of the old files and this folder was one of it. I attempted deleting this folder and windows does not allow me to do that. I have attached a screenshot of the same.

Thank you all for your assistance.

I was able to remove those folders using the bash command in windows, none of the windows tools removed those folders. I believe if I ran restic under linux I would not have encountered this issue. Though unfortunately I am unable to install restic under WSL for the moment.

Have you tried downloading the binary directly from the WSL prompt or using Cygwin? I think it should work. Here’s a link you may find useful.

1 Like

Thank you for the link, I will run through that and try to add restic under WSL.

1 Like