4 ms·
Nah, recycle bin is the wrong model. Automatic filesystem snapshoting is the way to go. Snapshots are cheap and let you recover full state from your history. J
by accelbred 2y ago
Nah, recycle bin is the wrong model. Automatic filesystem snapshoting is the way to go. Snapshots are cheap and let you recover full state from your history.
Just use btrfs, and set up btrbk to snapshot your home directory every 5 minutes, and have its gc keep every snapshot from past few hours, an hourly snapshot for past few days, and weekly for past few months.
- wruza 2y agoRecycle bin is just a different model. I have full disk weekly and homedir daily backups and could use live snapshots too, but it’s just easier to dig into the bin sorted by deletion date.
- miki123211 2y agoI wish filesystems had a first-in, first-out "garbage heap" model. The problem with snapshots is that they take up space. The trash has the same issue, with the added drawback that you have to think about emptying it, and if you empty it before realizing you made a mistake, it won't help you. With a "garbage heap" model, all deleted files would automatically end up on the "heap" when deleted. The heap would be exactly as large as the amount of free space you have left, and shrink when necessary by deleting the oldest files, perhaps with a minimum size (expressed in days) that would require manual action to shrink beyond.
- VoidWhisperer 2y agoThere would still have be some buffer between the amount of space you have left and the size of this heap - even if the OS were changed to treat this specific case as not being out of disk space, it would significantly impact write performance on the disk once it is 'full', because any disk operation would have potentially double the number of operations required compared to being able to write it to empty space on the disk
- E39M5S62 2y agoSnapshots on ZFS only take up space when files change. It's easy to use one of the many snapshot managers to accomplish what you want - I do it for my workstation and laptop. I have zero fear of deleting files, upgrading the OS, making sweeping changes to my system config, etc.
- accelbred 2y agoOn a CoW filesystem like btrfs/bcachefs/zfs, a snapshot only has the overhead of the delta, so are cheap. Btrbk can also take disk space into account for garbage collecting snapshots? Not sure.
- WhyNotHugo 2y agoSnapshots of home directories grow to ridiculous amount due to trash that piles inside of it. Off the top of my head: - ~/.local/share/docker is 29G of data that continuously mutates. - Rust/Cargo produce "target" directories in $PWD whenever they run, which is gigabytes of crap littered all over the place. Keeping snapshots of home would take up a huge amount of disk space, especially if you ever want to keep more than one. That said, keeping TWO snapshots for 24hs for "un-deleting" files might be an interesting idea.
- accelbred 2y agoI personally only snapshot Documents, Pictures, my git repo dir, etc. Stuff like .cache and podman stuff stays unsnapshotted. I just recommend to others to snapshot home since most people don't want to bother categorizing their data.