Then, always remember to delete /trash a few days later.
Then, always remember to delete /trash a few days later.
sudo apt install trash-cli
alias rm="echo This is not the command you want to use"
This way I managed to get unlearn my rm trigger-happyness and use trash instead. I had too many incidents already... ':| https://bugs.launchpad.net/ubuntu/+source/nautilus/+bug/1442649
this bug has been open for, uh, 7 years.Proposed tweaks: symbolic link into /var/trashlist directory, where the name of the symbolic link is "<timestamp>-<random stub>-<original basename>". Timestamp first so we can stop once we hit the first too-recent timestamp, random stub to unique the original base name if two different files In different directories are deleted at the same timestamp, original file name for inspection.
You're at 90%, and you have an app error spewing a few MB of logs per minute. Your on-call engineer /bin/rm's the logs, and instead of going to 30%, you're still at 91%, only the files are gone. Your engineer (rightfully) thinks "maybe the files are still on disk, and there's a filehandle holding the space", so instead of checking /proc to confirm, he bounces the service. Disk stays full, but you've incurred a few seconds of app downtime for no reason, and your engineer is still confused as shit. Your cron job won't kick in for hours? Days? In the mean time, you're still running out of disk, and sooner or later you'll hit 100% and have a real outage.
Cron job is a stupid hack. It doesn't solve any problems that aren't better solved a dozen other ways.
No documentation, no checklists? That's the source of your problem, not a trash command which moves files rather than deleting them.
Docs and checklists are fine, but at 2am when the jr is on call, you're asking for problems by making rm == mv
The best thing to do is to never operate with 2 terminals simultaneously, when one of them is a production env, better login/logout or at least minimise it.
It lead to a "Very Bad Day". I found out about it after reading the post mortem.
http://nilfs.sourceforge.net/en/
And/or a system like etckeeper to help keep a log on top of an fs that doesn't keep one for you: