So I have been playing with having a nightly backup job scheduled on my Windows 10 laptop using Task Scheduler. Now that Windows 10 includes SSH it is getting easier to do.
But I was surprised my backup of a 4GB directory was taking 2m30s to do a scan when nothing changed. Poking around with Task Manager I find that the Windows Defender malware scanner is running and taking up the time.
When I disable “Real-time protection” the time to run my null backup drops to like 10 seconds.
The only thing restic should be writing is the cache directory so I tried adding and execption for that directory, but it didn’t change anything. It appears the malware scanner is reading every file that restic considers for backup. At the end is a snippet of ProcMon when restic is executing.
Something about the way restic is opening the files is making the malware scanner think the file might have changed.
I was previously using duplicacy on my laptop and it manages to scan a directory without triggering a malware scan so I know it can be done.
Personally I would be happy just disabling Windows Default, but it automatically turns itself back on after a couple days which is a pain. I am hoping to have some friends and relatives use restic to backup to my server and am trying to create a easy to follow set of directions. Disabling Defender won’t work for that group. (They need all the help they can get.)
|8:26:13.6571587 AM|restic.exe|19500|QueryInformationVolume|C:\Users\wscott\Documents\My Games\Crysis_WARHEAD\Shaders\Cache\oceanbottom.cfxb|SUCCESS|VolumeCreationTime: 3/29/2018 7:49:57 PM, VolumeSerialNumber: 64A4-D08C, SupportsObjects: True, VolumeLabel: |
|---|---|---|---|---|---|---|
|8:26:13.6571735 AM|restic.exe|19500|QueryAllInformationFile|C:\Users\wscott\Documents\My Games\Crysis_WARHEAD\Shaders\Cache\oceanbottom.cfxb|BUFFER OVERFLOW|CreationTime: 3/29/2018 5:42:56 PM, LastAccessTime: 8/17/2008 3:52:07 AM, LastWriteTime: 8/17/2008 3:52:07 AM, ChangeTime: 3/29/2018 5:42:56 PM, FileAttributes: A, AllocationSize: 4,096, EndOfFile: 3,666, NumberOfLinks: 1, DeletePending: False, Directory: False, IndexNumber: 0x2000000029d01, EaSize: 0, Access: Generic Read, Position: 0, Mode: Synchronous IO Non-Alert, AlignmentRequirement: Long|
|8:26:13.6572729 AM|restic.exe|19500|CloseFile|C:\Users\wscott\Documents\My Games\Crysis_WARHEAD\Shaders\Cache\oceanbottom.cfxb|SUCCESS||
|8:26:13.6577010 AM|restic.exe|19500|CreateFile|C:\Users\wscott\Documents\My Games\Crysis_WARHEAD\Shaders\Cache\particles.cfxb|SUCCESS|Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened|
|8:26:13.6577299 AM|restic.exe|19500|QueryNetworkOpenInformationFile|C:\Users\wscott\Documents\My Games\Crysis_WARHEAD\Shaders\Cache\particles.cfxb|SUCCESS|CreationTime: 3/29/2018 5:48:07 PM, LastAccessTime: 8/17/2008 3:52:07 AM, LastWriteTime: 8/17/2008 3:52:07 AM, ChangeTime: 3/29/2018 5:48:07 PM, AllocationSize: 4096, EndOfFile: 2591, FileAttributes: A|
|8:26:13.6577440 AM|restic.exe|19500|CloseFile|C:\Users\wscott\Documents\My Games\Crysis_WARHEAD\Shaders\Cache\particles.cfxb|SUCCESS||
|8:26:13.6578808 AM|restic.exe|19500|CreateFile|C:\Users\wscott\Documents\My Games\Crysis_WARHEAD\Shaders\Cache\particles.cfxb|SUCCESS|Desired Access: Generic Read, Disposition: Open, Options: Synchronous IO Non-Alert, Non-Directory File, Attributes: N, ShareMode: Read, Write, AllocationSize: n/a, OpenResult: Opened|
|8:26:13.6579425 AM|restic.exe|19500|QueryEAFile|C:\Users\wscott\Documents\My Games\Crysis_WARHEAD\Shaders\Cache\particles.cfxb|SUCCESS||
|8:26:13.6586086 AM|MsMpEng.exe|4808|CreateFileMapping|C:\Users\wscott\Documents\My Games\Crysis_WARHEAD\Shaders\Cache\particles.cfxb|FILE LOCKED WITH ONLY READERS|SyncType: SyncTypeCreateSection, PageProtection: |PAGE_NOCACHE|
|8:26:13.6586252 AM|MsMpEng.exe|4808|QueryStandardInformationFile|C:\Users\wscott\Documents\My Games\Crysis_WARHEAD\Shaders\Cache\particles.cfxb|SUCCESS|AllocationSize: 4,096, EndOfFile: 2,591, NumberOfLinks: 1, DeletePending: False, Directory: False|
|8:26:13.6616433 AM|MsMpEng.exe|4808|LockFile|C:\ProgramData\Microsoft\Windows Defender\Scans\mpenginedb.db-shm|SUCCESS|Exclusive: False, Offset: 124, Length: 1, Fail Immediately: True|
|8:26:13.6616683 AM|MsMpEng.exe|4808|UnlockFileSingle|C:\ProgramData\Microsoft\Windows Defender\Scans\mpenginedb.db-shm|SUCCESS|Offset: 124, Length: 1|
|8:26:13.6633975 AM|restic.exe|19500|QueryInformationVolume|C:\Users\wscott\Documents\My Games\Crysis_WARHEAD\Shaders\Cache\particles.cfxb|SUCCESS|VolumeCreationTime: 3/29/2018 7:49:57 PM, VolumeSerialNumber: 64A4-D08C, SupportsObjects: True, VolumeLabel: |
|8:26:13.6634130 AM|restic.exe|19500|QueryAllInformationFile|C:\Users\wscott\Documents\My Games\Crysis_WARHEAD\Shaders\Cache\particles.cfxb|BUFFER OVERFLOW|CreationTime: 3/29/2018 5:48:07 PM, LastAccessTime: 8/17/2008 3:52:07 AM, LastWriteTime: 8/17/2008 3:52:07 AM, ChangeTime: 3/29/2018 5:48:07 PM, FileAttributes: A, AllocationSize: 4,096, EndOfFile: 2,591, NumberOfLinks: 1, DeletePending: False, Directory: False, IndexNumber: 0x100000002d56c, EaSize: 0, Access: Generic Read, Position: 0, Mode: Synchronous IO Non-Alert, AlignmentRequirement: Long|
|8:26:13.6634709 AM|restic.exe|19500|CloseFile|C:\Users\wscott\Documents\My Games\Crysis_WARHEAD\Shaders\Cache\particles.cfxb|SUCCESS||
|8:26:13.6637604 AM|restic.exe|19500|CreateFile|C:\Users\wscott\Documents\My Games\Crysis_WARHEAD\Shaders\Cache\particlesnomat.cfxb|SUCCESS|Desired Access: Read Attributes, Disposition: Open, Options: Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult: Opened|
|8:26:13.6637858 AM|restic.exe|19500|QueryNetworkOpenInformationFile|C:\Users\wscott\Documents\My Games\Crysis_WARHEAD\Shaders\Cache\particlesnomat.cfxb|SUCCESS|CreationTime: 3/29/2018 5:47:42 PM, LastAccessTime: 8/17/2008 3:52:07 AM, LastWriteTime: 8/17/2008 3:52:07 AM, ChangeTime: 3/29/2018 5:47:42 PM, AllocationSize: 368, EndOfFile: 362, FileAttributes: A|
|8:26:13.6637970 AM|restic.exe|19500|CloseFile|C:\Users\wscott\Documents\My Games\Crysis_WARHEAD\Shaders\Cache\particlesnomat.cfxb|SUCCESS||
|8:26:13.6639183 AM|restic.exe|19500|CreateFile|C:\Users\wscott\Documents\My Games\Crysis_WARHEAD\Shaders\Cache\particlesnomat.cfxb|SUCCESS|Desired Access: Generic Read, Disposition: Open, Options: Synchronous IO Non-Alert, Non-Directory File, Attributes: N, ShareMode: Read, Write, AllocationSize: n/a, OpenResult: Opened|
|8:26:13.6639695 AM|restic.exe|19500|QueryEAFile|C:\Users\wscott\Documents\My Games\Crysis_WARHEAD\Shaders\Cache\particlesnomat.cfxb|SUCCESS||
|8:26:13.6645989 AM|MsMpEng.exe|4808|CreateFileMapping|C:\Users\wscott\Documents\My Games\Crysis_WARHEAD\Shaders\Cache\particlesnomat.cfxb|FILE LOCKED WITH ONLY READERS|SyncType: SyncTypeCreateSection, PageProtection: |PAGE_NOCACHE|
|8:26:13.6646148 AM|MsMpEng.exe|4808|QueryStandardInformationFile|C:\Users\wscott\Documents\My Games\Crysis_WARHEAD\Shaders\Cache\particlesnomat.cfxb|SUCCESS|AllocationSize: 368, EndOfFile: 362, NumberOfLinks: 1, DeletePending: False, Directory: False|
|8:26:13.6668140 AM|MsMpEng.exe|4808|LockFile|C:\ProgramData\Microsoft\Windows Defender\Scans\mpenginedb.db-shm|SUCCESS|Exclusive: False, Offset: 124, Length: 1, Fail Immediately: True|
|8:26:13.6668401 AM|MsMpEng.exe|4808|UnlockFileSingle|C:\ProgramData\Microsoft\Windows Defender\Scans\mpenginedb.db-shm|SUCCESS|Offset: 124, Length: 1|