Post #1555996
2026-03-12 02:50 UTC
If the file system supports extended attributes you can (as root) change your files to be immutable like...
# cd archive; find -type f -exec chattr +i {} +
Under no circumstances ever are programs supposed to remove immutable, and while it's there, nothing can write to or delete the file.
Another (more portable) way to prevent naive programs trying to modify files is like:
# cd archive; find -type f -exec chmod a-w {} +
In that case, the superuser can modify the file (which is why you never run programs as superuser) but everyone else (even the owner) can't modify it without adding write access back.
Replies (0)
No replies.