Let's say I want to set one or more attributes (in the chattr sense) on every file created in a given directory. Is there a way to achieve this automatically, like umask does for file permissions ?

In other words, is there a way to omit the chattr step in :

$ copy file /path/to/backup/
$ chattr +i /path/to/backup/file

for every file created in /path/to/backup/ ?

Note : My system is Debian and my filesystem is ext3.


You can run inoticoming to watch for files placed in the directory and automatically run any command, in this case chattr. (note linux specific)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.