Program: update_links.pl Author: Ryan Wyler <ryan@nhorizon.net> Problem this program solves: Windows machines taking a LONG time to browse shares of automount points which include directories that are inaccessable to the samba server. Explanation: We have our samba shares setup to mount the unix automount directories. The problem is there are MANY automount directories that the sambaserver does not have access to automount because it is sensitive data and only shared out to specific netgroups/servers. When a Windows machine tries to browse the folders in the automount point windows attempts to go into EVERY SINGLE directory and pull out a desktop.ini file. This is a problem because there are several directories that the client will stall on because the server does not have access to the directories. So windows will request the desktop.ini file several times, and the server will attempt to mount the directory several times per each request. This results in a windows machine pulling up the directory in around 15 or 20 minutes! Solution: I came up with an idea. I made a directory called '/samba_links'. I wrote this script to go through ALL the automaps and create directories and links back to the correct location for all the directories that the server can mount. This way if a client will never request a desktop.ini file from a folder that is unmountable to the samba server. Instalation: This has ONLY been tested with NIS, not NIS+. This has been written for Solaris on a Solaris 2.6 machine. For linux it may need some tweeks but it possiably will work as is. Just throw this script in cron to run once a night or whenever you feel it should run. Example Setup: Crontab looks like (runs every morning at 1:00am): 0 1 * * * /opt/samba/bin/update_links.pl > /dev/null 2>&1 auto.master would look like: /projects auto.projects -rw,retry=3,nobrowse auto.projects would look like (server names accessable / unaccessable): project1 accessable:/export/project1 project2 accessable:/export/project2 project3 unaccessable:/export/project1 The directories that this script would create in that case would be: /samba_links /samba_links/projects Because the server 'unaccessable' is "unaccessable" the ONLY links that would be created in this case would be: /samba_links/projects/project1 -> /projects/project1 /samba_links/projects/project2 -> /projects/project2 Example smb.conf share: [projects] comment = Project Areas browseable = yes path = /samba_links/projects writable = yes Note: When you edit this, don't forget to use VI .. =) ALWAYS do the ':set ts=2' to change the tabspaces over to two spaces instead of 8 spaces. -- Ryan Wyler - ryan@nhorizon.net TekSystems U N I X [ Unix is very Friendly ... ... just pickier about who it makes friends with. ] -------------- next part -------------- A non-text attachment was scrubbed... Name: update_links.pl Type: application/x-perl Size: 6455 bytes Desc: not available Url : http://lists.samba.org/archive/samba/attachments/20000229/e594ab83/update_links.bin