Hello,
What ignore pattern would ignore the subfolder \AppData except for \AppData\ThisFolder
I have tried combinations of:
\AppData
!\AppData\ThisFolder
and
!\AppData\ThisFolder
\AppData
But it just ignores ‘ThisFolder’ regardless.
Hello,
What ignore pattern would ignore the subfolder \AppData except for \AppData\ThisFolder
I have tried combinations of:
\AppData
!\AppData\ThisFolder
and
!\AppData\ThisFolder
\AppData
But it just ignores ‘ThisFolder’ regardless.
/AppData/*
!/AppData/ThisFolder
Thanks but unfortuantely that didn’t work. Initially (with the forward slashes), I just got a blank AppData folder in the snapshot. When replacing with backslashes (\) that I presume Windows prefers, it snapshots the whole AppData folder, which I don’t need.
I should probably clarify that the folder I do want is actually in Roaming:
\AppData*
!\AppData\Roaming\ThisFolder
Windows might require backslashes indeed. I am not familiar with this OS.
But otherwise you got what you asked for:) Be precise when you ask for help. Nobody can see your screen.
For your new requirement what you need is:
/AppData/*
!/AppData/Roaming
/AppData/Roaming/*
!/AppData/Roaming/ThisFolder
Kopia is using git style exclusions. Google if you need more details.
Thanks and fair point re specifics. That’s still not working though. It’s uploading all of AppDate eg: all of of AppData/Local and AppData/LocalLow. I understand it’s using git style exclusions and have used google/chatgpt etc to no avail. Have success with this sort of set up in syncthing, so am wondering if it’s a bug.
I created similar dir structure in a temp folder.
$ tree AppData/
AppData/
├── data
│ └── aaa.txt
├── rrr.txt
└── Roaming
├── bbb.txt
├── ccc.txt
│ └── cc
└── ThisFolder
├── ffff.txt
└── xxxx
└── gggg.txt
configured exclusions:
$ kopia policy show /Users/kptsky/Temp
...
Files policy:
Ignore cache directories: true inherited from (global)
Ignore rules: (defined for this target)
/AppData/*
!/AppData/Roaming
/AppData/Roaming/*
!/AppData/Roaming/ThisFolder
Read ignore rules from files: inherited from (global)
.kopiaignore
Scan one filesystem only: false inherited from (global)
...
and created snapshot of my Temp folder.
Result:
$ kopia ls -r k5b5dbe2f302180259be6f5ceede9a4af/AppData
k5b5dbe2f302180259be6f5ceede9a4af/AppData/Roaming/
k5b5dbe2f302180259be6f5ceede9a4af/AppData/Roaming/ThisFolder/
k5b5dbe2f302180259be6f5ceede9a4af/AppData/Roaming/ThisFolder/xxxx/
k5b5dbe2f302180259be6f5ceede9a4af/AppData/Roaming/ThisFolder/xxxx/gggg.txt
k5b5dbe2f302180259be6f5ceede9a4af/AppData/Roaming/ThisFolder/ffff.txt
All works. Maybe on Windows things behave differently? Double check this “\ vs /” thing. Unfortunately no idea how it should be on your OS.
But does not look like there is a bug in kopia. At least not for exclusions parsing.
PS. Also very similar thread from the past. Looks like ppl used such exclusions on Windows successfully:
Hey thanks so much for your time helping with this. And we both stumbled across the same answer roughly the same time and you’re right the back/forward slash was the issue! Contrary to what I said previously, forward slashes did work.
So:
/AppData/Local
/AppData/LocalLow
/AppData/Roaming/*
!/AppData/Roaming/ThisFolder
Works…. but unfortunately this leads to the next problem. My plan is to basically ignore my AppData folder but selectively include the configs of various apps that I would like to backup. I thought based on this concept that the following would work:
/Downloads
/AppData/Local
/AppData/LocalLow
/AppData/Roaming/*
!/AppData/Roaming/ThisFolder1
!/AppData/Roaming/ThisFolder2
but I find once I add subsequent folders (eg: ‘ThisFolder2’ onwards) only one sub folder or file of ThisFolder2 is included…
I think I’m on the verge of giving up and either including the whole of AppData with it’s unnecesary bloat or manually backing up the selected AppData folders some other way as this seemed such a simple intention that feels unnecesarily complicated! Appreciate your help tho.
This is strange.. I use such exclusions (with multiple dirs) all the time.
What is your all exclusion - above looks like snippet only.
Using my test but now with extra folder included:
$ tree AppData/
AppData/
├── data
│ └── aaa.txt
├── Roaming
│ ├── bbb.txt
│ ├── ccc
│ │ └── cc.txt
│ ├── ThisFolder
│ │ ├── ffff.txt
│ │ └── xxxx
│ │ └── gggg.txt
│ └── ThisFolder1
│ ├── ccc.txt
│ └── ooo
│ └── iii.txt
└── rrr.txt
New rules:
/AppData/*
!/AppData/Roaming
/AppData/Roaming/*
!/AppData/Roaming/ThisFolder
!/AppData/Roaming/ThisFolder1
Result:
$ kopia ls -r k97deddc4bee20e7d5bcb9b6909e9b515/AppData
k97deddc4bee20e7d5bcb9b6909e9b515/AppData/Roaming/
k97deddc4bee20e7d5bcb9b6909e9b515/AppData/Roaming/ThisFolder/
k97deddc4bee20e7d5bcb9b6909e9b515/AppData/Roaming/ThisFolder/xxxx/
k97deddc4bee20e7d5bcb9b6909e9b515/AppData/Roaming/ThisFolder/xxxx/gggg.txt
k97deddc4bee20e7d5bcb9b6909e9b515/AppData/Roaming/ThisFolder/ffff.txt
k97deddc4bee20e7d5bcb9b6909e9b515/AppData/Roaming/ThisFolder1/
k97deddc4bee20e7d5bcb9b6909e9b515/AppData/Roaming/ThisFolder1/ooo/
k97deddc4bee20e7d5bcb9b6909e9b515/AppData/Roaming/ThisFolder1/ooo/iii.txt
k97deddc4bee20e7d5bcb9b6909e9b515/AppData/Roaming/ThisFolder1/ccc.txt
ThisFolder and ThisFolder1 are included with everything else excluded.
This is the entire ignore pattern text. I wonder if it’s come from repeated quick snapshots testing varying ignore patterns and maybe there’s some lag in the UI? I’ll keep experimenting. Really appreciate the help - thanks!
is wrong, it should be:
/Downloads
/AppData/*
!/AppData/Roaming
/AppData/Roaming/*
!/AppData/Roaming/ThisFolder1
!/AppData/Roaming/ThisFolder2
assuming that your objective is to include only /AppData/Roaming/ThisFolder1 and /AppData/Roaming/ThisFolder2 from /AppData. With subfolders inclusions you have to exclude and negate all levels of parent folders’ content.
Not sure why you added:
/AppData/Local
/AppData/LocalLow
If you want to achieve something else than you originally described:
then post your full dir tree and explain what needs to be included/excluded.
Mea culpa! So sorry. After a break from this and a night’s sleep, your pattern works:
/Downloads
/AppData/*
!/AppData/Roaming
/AppData/Roaming/*
!/AppData/Roaming/ThisFolder1
!/AppData/Roaming/ThisFolder2
I was rushing through all these trail and errors which just meant I missed something trying think. Thank you so much @kapitainsky . I need to do some more learning on git type ignore patterns as this isn’t the first time I’ve come unstuck by them!