I have a script that mounts an samba shared drive, copies the contents
if newer to the Linux box, and then umounts the share.
Sample script
---
mount -t smbfs -o username=x,password=y //machine/share /mnt/network
cp --recursive --preserve --verbose --parents --update /mnt/network/*
/backup/machine \
> log1.txt 2>log2.txt
umount /mnt/network
------------
End script
A couple of easy questions I can't seem to find answers to.
1. How can I pass in parameters from the command line to use as
variables.
myscript value1 value2
2. How can I have it dump a message to a log file if something fails and
then cease running the script.
if mount fail append to end of log1.txt "mounting failed",
terminate script.
I was under the impression that you could have a script terminate if a
command failed by having && separate the commands but this just
generates an error.
Paul Kraus
Network Administrator
PEL Supply Company
216.267.5775 Voice
216-267-6176 Fax
www.pelsupply.com
BEGIN:VCARD
VERSION:2.1
N:Kraus;Paul
FN:Paul Kraus ([EMAIL PROTECTED])
ORG:PEL Supply Company
TITLE:Network Administrator
TEL;WORK;VOICE:(216) 267-5775
TEL;CELL;VOICE:(216) 410-5526
TEL;WORK;FAX:(216) 267-6176
ADR;WORK:;;4666 Manufacturing Road;Cleveland;Ohio;44135;United States of America
LABEL;WORK;ENCODING=QUOTED-PRINTABLE:4666 Manufacturing Road=0D=0ACleveland, Ohio 44135=0D=0AUnited States of Ame=
rica
ADR;HOME:;;;;;;United States
LABEL;HOME:United States
URL;WORK:http://www.pelsupply.com
EMAIL;PREF;INTERNET:[EMAIL PROTECTED]
REV:20020416T182124Z
END:VCARD