Samba File Server

From FBSD_tips

Jump to: navigation, search

For those of us that use file servers regularly there is a problem we have all encountered... That is the dreaded accidental file deletion! That's no biggie right? I mean lets get it from the backup, WAIT i have no backup of it! As a result lost file. The following is a basic introduction to the VFS object recycle. It acts like the recycle bin on a local machine. Meaning that the file doesn't get deleted merely moved to a alternate directory that you specify. Although I use this in my production environment I can not promise it will work for you. PLEASE RTFM on VFS modules prior to using this.

# Samba config file created using SWAT
# from 10.0.12.154 (10.0.12.154)
# Date: 2008/05/12 19:42:32
 
[global]
        workgroup = ILSA_HOME
        server string = files5
        log file = /var/log/samba/log.%m
        max log size = 50
        dns proxy = No
        create mask = 0664
        directory mask = 0775
        hide dot files = yes
        socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=8192 SO_SNDBUF=8192
        #veto files = /.?*/
        #printcap name = cups
        #printing = cups
        #print command = 
        #lpq command = %p
        #lprm command = 
 
[media]
        comment = Media Files
        path = /media/storage/media
        valid users = @public, @private
        read only = No
        vfs objects = recycle
        recycle:exclude = *.tmp,*.temp, *.ini
        recycle:keeptree = Yes
        recycle:repository = /media/storage/recycle/%U
        recycle:touch = Yes
        #recycle:versions = yes
 
[itdata]
        comment = IT Data
        path = /media/storage/itdata
        valid users = @private
        force group = private
        read only = No
        vfs objects = recycle
        recycle:exclude = *.tmp,*.temp,*.ini
        recycle:keeptree = Yes
        recycle:repository = /media/storage/recycle/%U
        recycle:touch = Yes
 
[managers]
        comment = ILSA Mgmt.
        path = /media/storage/managers
        valid users = @managers
        force group = managers
        read only = No
        vfs objects = recycle
        recycle:exclude = *.tmp,*.temp
        recycle:keeptree = Yes
        recycle:repository = /media/storage/recycle/%U
        recycle:touch = Yes
 
[accounting-data]
        comment = ILSA Accounting
        path = /media/storage/accounting
        valid users = @accounting
        force group = accounting
        read only = No
        veto files = *.mp3
        vfs objects = recycle
        recycle:exclude = *.tmp,*.temp
        recycle:keeptree = Yes
        recycle:repository = /media/storage/recycle/%U
        recycle:touch = Yes
 
[ODrive]
        comment = ILSA Misc Files
        path = /media/storage/odrive
        valid users = @public
        read only = No
        vfs objects = recycle
        recycle:exclude = *.tmp,*.temp,*.ini
        recycle:keeptree = Yes
        recycle:repository = /media/storage/recycle/%U
        recycle:touch = Yes
 
[PDrive]
        comment = ILSA Client Files
        path = /media/storage/pdrive
        valid users = @public
        force group = public
        read only = No
        veto files = *.mp3
        vfs objects = recycle
        recycle:exclude = *.tmp,*.temp,*.ini
        recycle:keeptree = Yes
        recycle:repository = /media/storage/recycle/%U
        recycle:touch = Yes
 
[recycle]
        comment = IT
        path = /media/storage/recycle
        valid users = @private
        read only = No
        force group = private
        public = No
        admin users = @private
        veto files = *.mp3
 
[GDrive]
        comment = ILSA User Files
        path = /media/storage/gdrives/%U
        valid users = %U, @private
        browsable = No
        read only = No
        veto files = *.mp3
        vfs objects = recycle
        recycle:exclude = *.tmp,*.temp,*.ini,*.mp3
        recycle:keeptree = Yes
        recycle:repository = /media/storage/recycle/%U
        recycle:touch = Yes
 
[AllG]
        comment = All User Files
        path = /media/storage/gdrives
        valid users = ttaveras, @private
        force group = public
        browsable = No
        read only = No
        veto files = *.mp3
        vfs objects = recycle
        recycle:exclude = *.tmp,*.temp,*.ini,*.mp3
        recycle:keeptree = Yes
        recycle:repository = /media/storage/recycle/%U
        recycle:touch = Yes

As you can see it is pretty simple. Like I said this is a simple setup there are more features that I haven't even touched on yet. I hope this gets you started with using it though.

Personal tools