by znpy · 7y ago · 0 comments
Just use a snapshot-enabled filesystem. ZFS works awesomely, BTRFS too (but it's not released as stable and production ready AFAIK) and LVM can have snapshots too (take a look at the snapper project by Red Hat).
Just use ZFS and snapshot the whole filesystem.
I use the same setup (with a similar get of ignores) of my home being the root of a git repo for my dotfiles, but it's dotfiles alone that get added to git.
That being said, if you want to "version your home directory", I think that zfs is the best approach.
Also, transient files and browser temp files should reside on /tmp AFAIK... So that's less of an issue. If you application is writing temporary files outside of /tmp, then it's probably a bug.
http://www.mikerubel.org/computers/rsync_snapshots/
The idea is, you rsync to a snapshot directory (just like .zfs/snapshot/name_of_snapshot would be) but since you are hardlinking everything, almost all of the files take up zero space. Only files that change get their hardlinks broken and take up any space.
You can put the dir names in rotation and make them work exactly like zfs snapshots.
This is how people did snapshots before zfs.