shlogg · Early preview
Nurul Islam Rimon @nurulislamrimon

Make Your File Immutable With Chattr +i

Make your file Immutable to prevent unwanted overwrite: `chattr +i /your-file-path.txt`. Check attribute with `lsattr` and look for `---i----` to confirm. Saves you from cron job overwrites too!

Make your file Immutable to prevent unwanted overwrite.

chattr +i /your-file-path.txt

    
    

    
    




It will change your file's attribute. So you can check the attribute using the command below:

lsattr /your-file-path

    
    

    
    




If ---i---- exist, that means immutable attribute added.
It could save you from some cron job also. Last time I resolved my Nginx configuration overwrite by HestiaCP issue through the approach.
Have a good day!