Windows - another problem with directory excluding

Hi folks!

My girlfriend is running Windows what’s made me a grey-haired user. The whole day I’m trying to set up backuping process of her home dir. In the evening I’m feeling that I lost the last hair. :smiley: I got stuck on the problem with dir excluding. I would like to exclude every Temp dirs. I tried many permutations with different options, but without success. Then I read many questions here on the forum and fixed some of my mistakes. But now I’m at the end of my creativity.

This is my exclude file (with all options which I tried):

#Temp
#Temp\**
#C:\Users\valas\AppData\**\Temp
C:\Users\valas\AppData\LocalLow\Temp

I’m trying to run the simplest backup process:

restic -r D:\__BACKUP__\ backup --exclude-file C:\Users\valas\.config\crestic\restic_exclude.txt C:\Users\valas\AppData\LocalLow C:\Users\valas\Documents

But the Temp dir is always backuped. Can I ask you for a friendly kick to my “back” so I know how to solve it?

Hi,
Here are some of the items in my excludes_c.txt file:

# Rcache_0 is a "special line" which indicates do not store cache files determined by restic
*.tmp
# $ needs to be doubled because environment variables are expanded.
C:\$$Recycle.Bin
C:\Users\*\AppData\Local\Temp\
C:\Windows\Temp\**
C:\Windows\WinSxS\Temp\**

Also on the command line add “–use-fs-snapshot” to be able to read open files. I should likely use --iexclude instead of of exclude to ensure that case does not matter. I use “–json outputfile.txt” to save the output. I have lots and lots of excludes for the C:\ because microsoft stores so many things in so many directories. I also run “RegEdit.exe /e | backup_the_registry.reg” to backup the registry.
Hope this helps. You may find that backing up all files does not take all that long the second time. The backup of my C:\ drive with a bunch of excludes takes about 4 minutes.
Be sure to tell your virus checker to ignore the restic.exe

1 Like

Hi @punchcard,

many thx for your answer. During the weekend I’ll try this setting and let you know if it worked. :]

I don’t know what I had bad but now it works. Many THX!

My next milestone is to run the backup from Task Scheduler. If I have previously written that setting backup in M$ Win causes my hair loss. So setting to run crestic script via PowerShell causes me early retirement. But that’s a different story. :smiley: