5 Comments

  1. For the first part of your idea you could just schedule a “rm /home/user/thefile” with at/batch for now+7d.
    No searching the filesystem, no extended attributes needed. Flexible date parsing already implemented. And atq will nicely show you what is scheduled for the future.

  2. True, but that detaches the information from the file itself. Consider the situation when such a rm is scheduled, and you later move the file elsewhere and create a new file with the same name, then the wrong file gets deleted.

  3. That’s a very unlikely scenario. EA get copied with the file only if you use –preserve=xattr, so if you copy something temporary (draft) into another temporary copy or something you may want to keep (final document), you need to remember to check the EA as well. Or you need to adjusted the workflow (cp -p vs. cp -p=all/xattr) according to the desired result EA-wise.
    That’s more complex than the rm solution where you also need to know what you do, but the (implicit) rule is rather easy to remember (name drafts accordingly and not the same as a final document).

  4. There is always some workflow involved. But moving files retains the xattrs. Another advantage of xattrs is that it is easier to manipulate (f.i. prolongue its expiration time). With scheduled rm you’ll need to remove the scheduled job and create a new one.

    I’m more thinking about using the selinux contexts with the “expire after” method.

  5. I think that this would be very useful; I also have considered implementing it using extended attributes. Also, you may be interested in SEFS.

Leave a Reply

Your email address will not be published. Required fields are marked *