Today I was attempting to scope some css to an id. I found scopify-cli which does this. I installed it and attempted to run it.

It gave me an error. I looked in the pull requests and found #1. It updates the version of a few dependencies and it works again.

I executed it. The css in question was bulma.min.css.

cat bulma.min.css | scopify-cli '#todorender'

However, I made a mistake. This tool does not output to stdout. It writes to the current directory. It scopified almost every CSS file in my home directory until I noticed what was wrong and ^C'd it.

Now I needed to fix this mess. I have hourly backups with borgbackup, but I needed to use them and only extract css files. I looked up the documentation and spent ~20 minutes trying to make --exclude work. I then found --pattern and spent another 10 minutes trying to make that work. Every time it wouldn't match anything. I eventually found that I needed to use --exclude 're:something'.

I ended up with the following command:

borg extract --dry-run --list /data/Backups/borg/home/ssd::2020-11-06T20:00:02 'home/wingy/Code' --exclude 're:^((?!\.css).)*$'

I tested that it outputted the correct files and removed the --dry-run and did it again. Everything ended up being fine.

Lesson: RAID is not a backup. Learn to restore backups.