[Samba] Testing to see if drive mounted with smbmount

David Rankin drankin at cox-internet.com
Tue May 4 16:22:47 GMT 2004


Mates,

    I have set up a backup scheme that uses rsync to backup shares from my
mdk 7.2 box to an old ibm box that is running win95. Basically I use
"smbmount //backup/d /mnt/backup -o password=" to mount the ibm's d:/ as
/mnt/backup. How can I test to see if the drive is still mounted without
using another smbmount call prior to starting the rsync backup. smbmount
works for this, but is gives errors. My current script is as follows: (don't
laugh, it works) Also is there any way to stop rsync from trying to chown
each file which, in my case, doesn't make sense due to the target being a
winblows drive?? You thoughts are appreciated.

#!/bin/bash
DATE=`date`
echo $DATE >> /home/david/rsync.log
echo >> /home/david/rsync.log

if

        smbmount //backup/d /mnt/backup -o password=

then

        echo starting Rankin Law Firm backup >> /home/david/rsync.log
        echo >> /home/david/rsync.log

                /usr/bin/rsync -av --delete /home/samba/rankin/
/mnt/backup/rankin

        echo Rankin Law Firm backup -- [OK] >> /home/david/rsync.log
        echo >> /home/david/rsync.log

        echo starting Rankin-Bertin backup >> /home/david/rsync.log
        echo >> /home/david/rsync.log

                /usr/bin/rsync -av --delete /home/samba/rbpllc/
/mnt/backup/rbpllc

        echo Rankin-Bertin  backup -- [OK] >> /home/david/rsync.log
        echo >> /home/david/rsync.log

else

        echo smbmount of backup/d -- [Failed] >> /home/david/rsync.log
        echo >> /home/david/rsync.log

fi

--
David C. Rankin, J.D., P.E.
RANKIN * BERTIN, PLLC
510 Ochiltree Street
Nacogdoches, Texas 75961
(936) 715-9333
(936) 715-9339 fax
www.rankin-bertin.com
--



More information about the samba mailing list