Is there any way to make a dir undeletable but writeable?

rado84

Well-Known Member
Joined
Feb 25, 2019
Messages
790
Reaction score
644
Credits
5,031
A day or two ago, after an update, my home dir Images disappeared which was bad because my panel icons are there, gnome screenshot uses it as a target directory for screenshots and other icons are there as well. I have a full backup of that dir, so I recreated the directory and recovered the icons. However, since the new directory was created by me and not by the system, gnome screenshot couldn't find it and therefore couldn't save the screenshots. At this point I had three options - either change the source of GS again to save them in another directory and then reinstall GS with the changed source, restore the system from a month old backup or completely reinstall Linux. I chose option two, so now even after the full system upgrade everything's fine. But I wanna prevent something like that happening in the future, so here's my question: is there any way to make that directory in question (~/Images) unremovable but at the same time it has to be writeable? Meaning that nothing can delete the directory and yet both me and programs be able to create and change stuff inside it? Something like "# chattr +i" with the only difference that users and programs will be able to write in the directory.
 

Members online


Latest posts

Top