Networking | Hardware | Software | Multimedia | System | Unix&Linux | MBA

Home>>Unix&Linux>>Automated smbfs mount with cron

Automated smbfs mount with cron

dspeer
06-02-2005, 04:16 PM
I have a smb connection between 2 machines that absolutely HAS to be open at all times. 5 minutes downtime is no problem, 30 minutes downtime would be.

With help from this forum and the man page I came up with this script that I intend to run via cron every ten minutes or so:


#!/bin/bash
if [ ! -f /Volumes/PUBLIC/testfile ]
then
mount_smbfs -U Administrator:Open171 //Administrator@192.168.12.12/PUBLIC /Volumes/PUBLIC
fi
exit 0



The problem: When the connection is not there, the directory /PUBLIC is not there. When I run this script in that case, it barks at me: "Can;t find directory /Volumes/PUBLIC. Which, of course, is why I am running this.
What am I doing wrong?

Any help appreciated!

uli_the_knecht
06-07-2005, 04:08 PM
i tried this out and i first had to create the directory at "/Volumes/".

mkdir /Volumes/SMB_Directory/

breen
06-08-2005, 10:02 AM
I usually do something like this:


#! /bin/bash

[ ! -d ~/marketing ] && mkdir ~/marketing
smbmount //marketing/public ~/marketing -o username=breen


(If I were re-writing that scriptlet now I'd probably take the time to write the directory name as $HOME/marketing .)


 

TOP

Windows Server Outsell
Unix Signals And C++ E

For more info

Unix Signals And C++ E
Windows Server Outsell
ssh setup for password
Bash script does not w
esc code 
ARD send unix command 
question about binarie
Scanning mail 
Issuing multiple comma
How do I install Linux

News Archive

/etc/hosts? 
Manually Start a Start
mounting missed hard d
Using Netinfo in Singl
darwin/bsd login probl
system_profiler and fi
Send mail from script 
mounting a drive 
OS X disk first aid ha
system.log shows steal

Related stories:

new to Tiger: ssh asks for s/key instead of regular password
Check web page download times - use curl?
deleting unix mail
lsof - List open *files*?
How Do I access my USB Drive
Restart Rendezvous only?
stop cron from sending mail

Copyright@2004-2005 www.zzcoke.com All Right Reserved

advanced web statistics