4 ms·
What's the 'best' way of protecting against this sort of thing? Extremely frequent diff based backups? Firejails? The latter seems a more appropriate/thorough
by OJFord 5y ago
What's the 'best' way of protecting against this sort of thing?
Extremely frequent diff based backups? Firejails?
The latter seems a more appropriate/thorough solution, but isn't that convenient, seems mostly people use it for select programs they already slightly distrust.
- chockchocschoir 5y agoUse the package manager your OS ships with and stay away from customized install scripts from various 3rd parties. This is not the first time this has happened, most famous one was probably that Steam bug some years ago that deleted everything for people.
- dmw_ng 5y agoOS packagers have bugs like this every so often, because they still run custom upgrade scripts behind the scenes. Pretty sure I remember one in Debian a few years back (sorry, name escapes), and it was not the first time I remember seeing that.
- chockchocschoir 5y agoI might just have been lucky then as that has never happened to me in almost +30 years of using various distributions like Ubuntu, Debian, Arch, CentOS, Redhat and more. Literally not a single time this has happened to me on either desktop nor server. But as I said, I might just have been lucky. Looks like I will increase my backup frequency now.
- danuker 5y agoThe first time I installed Linux was around 2007. I use it as my main OS since 2010. I have only lost data due to hard drive failure, or at my own request (i.e formatting over what I thought I had backed up). I recently enabled TRIM on my full-disk-encrypted SSD system. No sign of data loss yet. I have always used ext3/ext4.
- btrettel 5y agoHN link on the Steam bug: https://news.ycombinator.com/item?id=8896186 https://news.ycombinator.com/item?id=8896186
- howinteresting 5y agoPeriodic btrfs or zfs snapshots are an easy solution to this class of issue, and simpler than full off-site backups (which are also important but can be done less frequently).
- jbergens 5y agoYears ago we used a simple 3rd party cloud backup an all employee computers. It was very easy to find old versions or files. Might be useful for more companies. Google Drive and OneDrive has similar solutions today but they often only takes the home folder, the one we used could take a lot more.
- tacone 5y agoUse docker for local development (will protect files outside the project), version the project with git (will mitigate the damage if you mount the source folder as a docker volume) and make sure the .git folder does not end up in the container file system.
- lokedhs 5y agoUse Qubes OS. It will help you in different ways. Firstly, if a problem happens, only the specific environment is affected (such as the project you're working on), secondly any changes outside of the home directory will be reverted (this was not an issue in example in question but it can happen in other cases, such as a sudo make install deleting stuff from /usr/bin), finally if something really bad happens you can always revert the specific vm where the problem happened. A lot of information about Qubes talk about protection against attacks, but it's also useful against unintentional issues, and I'd argue that's a much more common case where Qubes shines.
- LinuxBender 5y agoExtremely frequent diff based backups? My personal preference is to rsync to a backup host in a daily cron. Hourly for important directories. That backup host then runs rsnapshot [1] locally and the snapshots are made read-only. Important files are then backed up off-site. rsnapshot is just a perl script that creates multiple diff snapshots and uses hardlinks to save space. It is available for most distros. I believe it is also in macports and homebrew for mac. [1] - https://wiki.archlinux.org/title/rsnapshot https://wiki.archlinux.org/title/rsnapshot