[Dirvish] Dirvish backing up Windows 2003, but having troubles viewing backups in Samba (perm/ownership)

Richard Geoffrion dirvish at rain4us.net
Wed Jun 21 18:42:49 UTC 2006


hanj wrote:

><snip> My backups are backing up windows file shares (just normal data.. no worries on 'lock' files, etc). We would like to give users the ability to browse and grab files from the backup server. I have samba installed on that box.. and again, everything is working fine with that. The problem is related to file permissions on the windows backups.
>
><snip> ..the permissions carried over from the windows filesystem...<snip> make it difficult to browse via samba. Almost all files/directories brought over from Windows has these permissions. 
><snip>
>I know you can 'restore' with rsync, but I would like to avoid this. I want to maintain 'read-only' on the windows side of things. Also, users will my need several copies (versions) of the same file... and they need to browse through the images.
>
>Now my questions are....
>
>Does anyone else run into this similar problem?
>Does anyone have a clever fix (maybe rsync option or samba configuration) to avoid this?
>  
>
I have a proposed solution that should work well for you.  The solution 
lies in the configuration on the SAMBA share.  Explore the  "force user" 
and "force group" share configuration options in the smb.conf file.

Example:
Create a group called gr_ws1u  #(GRoup_WindowsServer1Users)
Assign the necessary users to the group.
Create the following file share in your smb.conf ....
[winserver1backup]
        writeable = no
        path = /banks/windows/winsrv1
        force group = root
        force user = root
        comment = Backup for Windows Server 1
        valid users = @gr_ws1u

And VOILA!.  The users in the group 'gr_ws1u' will be able to read any 
file in that share's $PATH as if they were root.  The will not be able 
to WRITE to that share as the smbd daemon will protect that share 
through the 'writable=no' directive.

The real trick would be to provide a link to the ./tree/ directory of 
certain images.   The closest thing that I have thought of to accomplish 
this is to have a path that contains symlinks to the actual ./tree/ 
directory.

EX:

ln -s /banks/windows/winsrv1/2006-05-01/tree 
/home/restore/winserver1-2006-05-01
ln -s /banks/windows/winsrv1/2006-05-02/tree 
/home/restore/winserver1-2006-05-02

Then one could just share the '/home/restore/' path.

One could even have a post dirvish cron job that could....
ln -s /banks/windows/winsrv1/`date +%F`/tree/ 
/home/restore/winserver1-`date +%F`

This would create your symlinks on-the-fly.  You would have to think of 
a way to remove them once they expire.  I wonder if it would be possible 
to issue a 'find' command that could find any broken softlinks and 'rm' 
them?  I'm sure there is a way...I haven't looked for it yet though.

-- 
Richard  | /"\    ASCII Ribbon Campaign
	 | \ /    No HTML/RTF in e-mail
	 |  X     No Word docs in e-mail
	 | / \    Respect for open standards




More information about the Dirvish mailing list