Maikel Lambregts wrote:
Hi,

I want to make automatic backup of my MySQL by using FreeBSD snapshots. All
works fine when I run the commands from my Putty, but when I run them from a
shell script the 2th command (mdconfig) gives an error.
These are the comments to make the backup, that work fine from Putty =>

========================================
/usr/local/bin/mysql -u??? -p??? -e "FLUSH TABLES WITH READ LOCK;system
mksnap_ffs /usr /usr/snapshot;UNLOCK TABLES;"
mdconfig -a -t vnode -f /usr/snapshot -u 4
mount -r /dev/md4 /mnt
tar -cvjf /usr/home/mysqlsnapshot.tar.bz2 /mnt/home/databases
umount /mnt
mdconfig -d -u 4
rm -f /usr/snapshot
========================================

I get this error when I run the above from a .sh script =>

myserver# ./mysqlsnapshot.sh
: not found
mdconfig: bad unit: 4
: No such file or directory

This is not a mdconfig question, rather a basic shell scripting question. Use "sh -x" to run the script to see what it is doing wrong.

One problem is that you are missing lots of error handling. If any of those commands fails then subsequent commands may misbehave.

Kris
_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to