umount /mountpoint after x minutes?

Pete pete at geenhuizen.net
Tue May 14 13:16:52 UTC 2013


On 05/14/2013 08:58 AM, Frank Murphy wrote:
> I have an nfs share mounted in /etc/fstab
> server:/share /mountpoint nfs re,auto,lock,inte 00
>
>
> Is it possible to to have it auto umount /mountpoint,
> after x minutes?
>
> looked at man idle, man bash, man umount
> Googled: "umount dir after set time"
>
man autofs
   -t, --timeout
               Set the global minimum timeout, in  seconds,  until 
directories
               are unmounted. The default is 10 minutes. Setting the 
timeout to
               zero disables umounts completely.

If you don't want to set a global timeout you can specify a different 
timeout for each mount

man auto.master

              -t, --timeout <seconds>
                      Set the expire timeout for map entries. This 
option  can
                      be  used  to  override the global default given 
either on
                      the command line or in the configuration.

Pete

-- 
Unencumbered by the thought process.
  -- Click and Clack the Tappet brothers



More information about the users mailing list