I want to backup all office files and the newly created later in one folder and exclude all other types
How to write the exclude file ?
Thank you.
my test data folder tree is below
D:\RESTIC-TEST\DATA
โ ๆบ่ฝๅน้
็ณป็ปV3.pdf
โ
โโโโ1
โ winserv.exe
โ
โโโโ2
โ โ winserv.exe
โ โ
โ โโโโ2-1
โ โ ้ฟ้oss.txt
โ โ
โ โโโโ2-2
โ โ 2021-08-25.log
โ โ 2021-08-30.log
โ โ CACHEDIR.TAG
โ โ
โ โโโโ2-3
โ ๅผๆญฅๆถๆฏๆจ้้
็ฝฎ่กจ.xlsx
โ
โโโโ3
members.json
WeChat Image_20200722150945.jpg
ๆผๅๆฅๅฟ.zip
my restic backup command is
restic -r repo -p key backup --exclude-caches --iexclude-file exclude.txt --files-from file.txt -n -vvv
my file.txt content is
D:/restic-test/data/*.pdf
D:\restic-test\data\2\2-3\*.xlsx
Is it possible to make include file supports walk recursively? so just this line will include all excel file
D:/restic-test/data/**/*.xls[xm]
Hi @kuyagic and welcome to the restic community!
Thanks for the detailed report. Just making sure you havenโt missed this, have you seen the documentation around excluding files?
If not give this a read and see if the information there provides enough information to solve your problem.
https://restic.readthedocs.io/en/latest/040_backup.html#excluding-files
โฆ got same Problem - but in my case only SumatraPDF Files, so I try this:
(I like to use AkelPad to generate a Text-File in UTF-8 Coded)
# OnlySumatraFiles.txt:
## First exclude all Windows-Drive-Letters:
/A/*
/B/*
/C/*
/D/*
/E/*
/F/*
/G/*
/H/*
/I/*
/J/*
/K/*
/L/*
/M/*
/N/*
/O/*
/P/*
/Q/*
/R/*
/S/*
/T/*
/U/*
/V/*
/W/*
/X/*
/Y/*
/Z/*
## Than re-include the wanted File-Types:
!**/*.PDF
!**/*.EPUB
!**/*.MOBI
!**/*.CHM
!**/*.XPS
!**/*.DjVu
!**/*.CBZ
!**/*.CBR
!**/*.JPG
!**/*.JPEG
!**/*.GIF
!**/*.PNG
!**/*.BMP
!**/*.TGA
!**/*.TIF
!**/*.TIFF
!**/*.WEBP
!**/*.txt
I prefer the CMD-Shell in Window - or sometimes a CMD-Script:
A:\> set "RESTIC_REPOSITORY=\\Nas\BackUpDrive\BackUpFolder"
A:\> set "RESTIC_PASSWORD=eins,Zwo-Drei!4"
A:\> set "TMPDIR=%tmp%"
A:\> restic backup --iexclude-file OnlySumatraFiles.txt -x --use-fs-snapshot "%UserProFile%"
and I also can backup any other Drive - maybe an eReader:
A:\> restic backup --iexclude-file OnlySumatraFiles.txt "B:\"
Do you see any Errors?
what does this file OnlySumatraFiles.txt contain?
???
From Backing up โ restic 0.16.3 documentation :
[Negative excludes:] It works similarly to
gitignore
, with the same limitation: once a directory is excluded, it is not possible to include files inside the directory
That is once a directory has been excluded (due to the /A/*
patterns), no files in that directory will be backed up. See also Only include some specific file extensions in backup