I'm mounting a truecrypt container via the command line (i.e. truecrypt file dir). Is there any way to have truecrypt automatically unmount the container after a given amount of inactivity in dir?
|
|
||||
|
Truecrypt can't do this but something like the following would accomplish what you are trying to do:
The Save this somewhere,
I would definitely incorporate some type of notification so you have a chance to close open files. Of course you could get rather elaborate and try to incorporate a loop that kills with SIGTERM (and then does SIGKILL if it doesn't respond in a timeframe) all processes listed by |
|||
|
truecryptbe mounted with themountcommand? – Nils Sep 6 '12 at 21:24lsof(or possibly /proc/*/fd or somesuch; lsof gets its data from somewhere...)? It wouldn't be perfect (very fast accesses would go uncaught, and it would cause a bit of CPU hammering), but I'm guessing it's either something like that, or access notifies (which at the very least means write a system application, not a script). – Michael Kjörling Jan 4 at 12:40