[BUGS] rsync + smbfs

Jerahmy Pocott quakenet1 at optusnet.com.au
Wed Jan 2 08:18:21 EST 2008


On 02/01/2008, at 7:54 AM, Jerahmy Pocott wrote:

> But I'm wanting to run a backup from cron, the problem is that I can't
> mount the smbfs shares from fstab, it works fine from fstab if the
> shares are on the local subnet, but it fails when they are on a
> different subnet (which mine are) due to netbios name lookup failing.
> From the command line I can specify -I x.x.x.x to supersede netbios,
> however you can't seem to do this from fstab.. I tried creating
> a .nsmbrc for root that had the IP address set for the server, but to
> no avail. Also putting the IP address as the server name in fstab
> fails for some reason!

Okay, I know replying to myself is bad, but I discovered that by  
putting -Ix.x.x.x into the fstab in the options section makes it work  
as it does from the command line and placing the passwords in  
roots .nsmbrc allows it to mount from fstab without user input.

> Any way, what I want to do is create a script that will run from cron
> that 1) checks the smbfs is mounted and mounts it if needed, 2)
> performs the rsync and mails me a log. However I'm not sure how to
> achieve step 1 without fstab, as simply calling the mount command will
> actually mount the same share on top of any existing mounted share and
> I don't really want the share mounted multiple times!

So I'm still at 1, I need a way to check from a script if the  
filesystem is mounted, I was thinking of setting them as 'late' in  
fstab and just calling mount -al prior to running the backup, but that  
would only work so long as the mounts were successful. So really I  
still need to check that the fs is mounted regardless.. I don't know  
of any way to check this other than calling mount with no  options,  
which doesn't really make for easy scripting.

Thanks for any ideas!
J.


More information about the BUGS mailing list