Share a folder from command line?

Share your awesome tips and tricks here.
Post Reply
mkp
Posts: 10
youtube meble na wymiar Warszawa
Joined: Thu Sep 18, 2014 7:18 pm
Location: Amsterdam - if I'm not traveling :-)
Contact:

Share a folder from command line?

Post by mkp »

If I create a directory in a script, is there a way to share that folder from that script as well? IOW can I share a folder from the command line? Either for a particular sharing method (like Samba) or at once for all enabled share methods?
AS-604T
4x WD Red 4TB in RAID 10
variable set of external USB HDs and USB flash drives (for syncing and backup)
User avatar
clinton.hall
Posts: 845
Joined: Thu May 09, 2013 7:01 pm
Location: New Zealand
Contact:

Re: Share a folder from command line?

Post by clinton.hall »

this may not be what you are after, but the simple way is to create a symlink to that directory in /volume1/Public/
this imediately makes it accessible (as long as the appropriate user and permissions are set.

otherwise, any script to add a directory to samba would need to edit the samba settings file(s) and maybe restart the samba service (but I haven't played with any of that, so just thinking out loud. for my Apps I just use a symlink into Public)
AS-604T
3 x ST4000DM0000 (Seagate 4TB) in Raid5
2 GB RAM expansion
AS-302T

Apps (user)
NZBGet - CouchPotato - SickBeard - Git - Python

Apps (maintainer):
NZBGet - BitTorrent Sync - Mylar - LazyLibrarian - Gamez
-Maintenance of Apps acquired from JohhnyFive since ADM2.0:
SABnzbd - CouchPotato - SickBeard - HeadPhones - Subsonic

About Me: http://fockwulf.wix.com/index
mkp
Posts: 10
Joined: Thu Sep 18, 2014 7:18 pm
Location: Amsterdam - if I'm not traveling :-)
Contact:

Re: Share a folder from command line?

Post by mkp »

clinton.hall wrote:this may not be what you are after, but the simple way is to create a symlink to that directory in /volume1/Public/
this imediately makes it accessible (as long as the appropriate user and permissions are set.
Good idea, thanks - I had not thought of that: it seems I tend to ignore "Public" folders. :? That sounds like it might at least work. Maybe even a special folder with properties similar to Public? I'll play around a little with that.
clinton.hall wrote:otherwise, any script to add a directory to samba would need to edit the samba settings file(s) and maybe restart the samba service
Another thing to play with, great. I've already figured out where most of the system scripts are living, so restarting a service should be no problem.
AS-604T
4x WD Red 4TB in RAID 10
variable set of external USB HDs and USB flash drives (for syncing and backup)
sajjad123
Posts: 1
Joined: Tue Dec 16, 2014 5:58 pm

Re: Share a folder from command line?

Post by sajjad123 »

otherwise, any script to add a directory to samba would need to edit the samba settings file(s) and maybe restart the samba service
We offer best quality HP2-K38 exam dump test papers and test-king.org - HP0-J67 dumps materials. You can get our usna guaranteed www.bostonconservatory.edu questions and Rasmussen College
Post Reply

Return to “Tips & Tricks”