Operating System - Linux
1829090 Members
2435 Online
109986 Solutions
New Discussion

define sharing on temporary basis

 
Jees Joy
Frequent Advisor

define sharing on temporary basis

Hi friendz

I am trying to share a particular folder on a temporary basis, I dont want to specify in /etc/exportfs. I just want to share it for some particular limited time only. I tried share command but its not working in linux, could you guys suggest me anything helpful thanks
3 REPLIES 3
Steven E. Protter
Exalted Contributor

Re: define sharing on temporary basis

Shalom Jees,

It has to go into a configuration file. You can't do it on the fly.

Add it to /etc/exports, or add it to smb.conf restart the perspective daemon.

You can use a cron or at job to return the configuration job to its prior state.

Make a copy of /etc/exports

cp /etc/exports /root/exports.tmp

Edit it, add your share.

Script:

cp /etc/exports /root/exports.perm
cp /root/exports.tmp /etc
exportfs -av
sleep 20000 # pick any number you want.
cp /root/exports.perm /etc
exportfs -av

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Alexander Chuzhoy
Honored Contributor

Re: define sharing on temporary basis

you can use the exportfs command:


Very simple example to export /tmp to all:

exportfs hostname:/tmp

to unexport everything:


exportfs -ua
Jees Joy
Frequent Advisor

Re: define sharing on temporary basis

Thank you frenz, for the quick response