TheSpeedoBeast
06-13-2005, 10:42 AM
I am in the process of writing my first program ever! (A simple bash script to back up important files to my windows computer from my linux server).
This is my problem: one of the backups I am doing is dumping my mysql tables to my windows partition (via samba). That all works fine and dandy, but when I do that, it prompts me for my mysql table passwords for each table. Is there any way to automatically enter the password in the script, so that I do not have to type my mysql table passwords in four times? Any help here is greatly appreciated!
#!/bin/bash
mount //UPSTAIRS/SharedDocs
cd /var
tar -czf www.tar www/
mv www.tar /mnt/upstairs
cd /home/shook
tar -czf Maildir.tar Maildir/
mv Maildir.tar /mnt/upstairs
mysqldump --opt -p forum > /mnt/upstairs/forum.dump
mysqldump --opt -p wordpress > /mnt/upstairs/wordpress.dump
mysqldump --opt -p gregg > /mnt/upstairs/gregg.dump
mysqldump --opt -p photo > /mnt/upstairs/photo.dump
umount //UPSTAIRS/SharedDocs
This is my problem: one of the backups I am doing is dumping my mysql tables to my windows partition (via samba). That all works fine and dandy, but when I do that, it prompts me for my mysql table passwords for each table. Is there any way to automatically enter the password in the script, so that I do not have to type my mysql table passwords in four times? Any help here is greatly appreciated!
#!/bin/bash
mount //UPSTAIRS/SharedDocs
cd /var
tar -czf www.tar www/
mv www.tar /mnt/upstairs
cd /home/shook
tar -czf Maildir.tar Maildir/
mv Maildir.tar /mnt/upstairs
mysqldump --opt -p forum > /mnt/upstairs/forum.dump
mysqldump --opt -p wordpress > /mnt/upstairs/wordpress.dump
mysqldump --opt -p gregg > /mnt/upstairs/gregg.dump
mysqldump --opt -p photo > /mnt/upstairs/photo.dump
umount //UPSTAIRS/SharedDocs