(solved) How to chattr +i on directories as a cron job?


Recommended Posts

Hello all,

 

I'd like to harden my servers against ransomware from my SMB shares. I used to use the deprecated plugin, but that's not updated anymore. 

 

I read a bunch of forum threads about this and some people suggested a scheme to set directories/shares to chattr +i on a set schedule, so new files can be added and then locked down. I did a few files manually via ssh and liked how well it worked. The problem is I don't know how to automate it. I assume they are doing a cron job or something... like that to make that happen. Ideally I'd like to set it per-directory so incoming stuff has it applied after it gets moved and dynamix integrity and plex do their hashing and metadata when applicable.

 

How can I schedule something like that? I know very little about basic linux stuff and just about nothing about cron other than you can schedule stuff with it. 

 

Thanks!

 

 

 

 

Edited by Ouze
solved
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.