restore mysql dump file in many remote servers?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting restore mysql dump file in many remote servers?
# 1  
Old 09-12-2006
restore mysql dump file in many remote servers?

Hi all,
I want to restore DB file in many mysql servers, i already using script for sending the dumpfile in all servers, but it's just annoying if i have to restore the dumpfile in all servers, i want just execute 1 script, and will restore in all remote mysql servers. I make script but not working, im sure my logics it's not correct Smilie
Hope somebody can help me.

Thanks.
# 2  
Old 09-12-2006
for anybody in this forum to help, you should have posted your script.
# 3  
Old 09-13-2006
Quote:
Originally Posted by ghostdog74
for anybody in this forum to help, you should have posted your script.
Im sorry. here is my script. Maybe somebody can help me, or have other way, thanks.

#!/bin/sh
export PATH=$PATH:/home/mysql/bin

jam=`date +%d%b%y`

mysqldump --database testdb -u root --password=password > /home/cabang/testdb-$jam.dmp
cd /home/cabang
tar zcfv jasper-$jam.tgz testdb-$jam.dmp

#Ftp for all branch
#MDN
ftp -n 192.168.4.25 <<!
quote user admin
quote pass password
bin
prompt
mput testdb-$jam.tgz
quit
#restore to mdn script
# Seems that this script wont work, coz, now im working in remote server
#just stop in ssh remote only
ssh 192.168.4.25
cd /home/admin
tar zxfv testdb-$jam.tgz
cd /home/mysql/mysql --database testdbmdn -u root --password < /home/admin/testdb-$jam.dmp
exit

#PLB
ftp -n 192.168.5.25 <<!
quote user admin
quote pass password
bin
prompt
mput testdb-$jam.tgz
quit
#restore to mdn script
# Seems that this script wont work, coz, now im working in remote server
ssh 192.168.4.25
cd /home/admin
tar zxfv testdb-$jam.tgz
cd /home/mysql/mysql --database testdbplb -u root --password < /home/admin/testdb-$jam.dmp
exit

......
......
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX and Linux Applications

How to import and dump file to remote Oracle server?

Hi All, I have a linux centos instance which has a dump file. I need to import the dump file to the oracle server which is located at some remote location. I have installed the oracle client on my machine and I am able to connect to the remote oracle server. Now how to import the dump to the... (3 Replies)
Discussion started by: Palak Sharma
3 Replies

2. Solaris

restore dump from veritas format using ufs file system

hi all i have a DLT tape in that tape backup is there is in veritas volume format and i want to restore it in ufs file system how can i do it? right now i don't have veritas file system setup. i have only ufs file sysytem please help some production data is to be restore. (3 Replies)
Discussion started by: nikhil kasar
3 Replies

3. Shell Programming and Scripting

Can't add variable to file name in mySQL dump script

I have a script (below) which works ok, but I have tried to modify it as I want to keep the older files for a restore if needed. I have tried adding a date suffix to the newly created files (second lump of code), but it doesn't seem to work. I get the error: $SOURCEDIR/p1db_$DATEVAR.sql:... (3 Replies)
Discussion started by: ojobson
3 Replies

4. UNIX for Dummies Questions & Answers

dump/restore of a fs with 100 of millions hardlinks

Hi :-) i have a dump of a backupdisk (~540GB / ext3). The Backups have some 100 millions of hardlinks (backups are created with storeBackup). The OS is linux. A restore of a directory ended after some days with the errormessage "no memory to extend symbol table" The restore of the complete... (0 Replies)
Discussion started by: turricum
0 Replies

5. UNIX for Dummies Questions & Answers

Dump and Restore

I want to copy over the contents of one partition on hard drive A to another partition on hard drive B. Using DD command caused problems since it overwrote the partition information on hard drive B and made hard drive B's partition size the same as the one on partition A. Our department manager... (5 Replies)
Discussion started by: mojoman
5 Replies

6. UNIX for Dummies Questions & Answers

How to restore a dump file on the disk

Hi all, i am a real dummy to unix and in need of help.My platform is Sun solaris(5.9) I have a dump file, an oracle cold backup taken with ufsdump command. This dump file resides on the disk, not the tape. I want to extract this dump file to a directory. But i cant, i read about ufsrestore... (1 Reply)
Discussion started by: merope
1 Replies

7. UNIX for Dummies Questions & Answers

Dump and restore problem

Hi all, having problem with dump & restore for cloning simple linux system. The command is : dump -0u -f /temp/var.dump /dev/sda5 But somehow the result displayed: ~~~~~~ dump: ACLs in inode #1250760 won't be dumped: Inappropriate ioctl for device dump: ACLs in inode #1250761 won't be... (1 Reply)
Discussion started by: mycoolwater
1 Replies

8. Shell Programming and Scripting

how to break mysql dump sql file

Hi folks I have mysql dump which having insert queries, i want to break that file when 10 complete "INSERTS" lines so extract that line and store in 1.sql and 2.sql and for next 10 insert lines. pls guide me how can i do that. Regards, Bash (2 Replies)
Discussion started by: learnbash
2 Replies

9. Red Hat

Dump and restore command usage ??

Hi, I am using RHEL 4.0 I need to take backup of a directory and then restore it to some other location. For taking Backup of final directory, I am using this code: dump -0aj -f /home/vicky/final.dump /home/vicky/final/ Now, I am trying to restore this final.dump to some other... (2 Replies)
Discussion started by: vikas027
2 Replies

10. UNIX for Dummies Questions & Answers

restore dump - help

I have a file with .dmp.gz. I am trying to uncompress this file in a new directory. was able to use gzip to take off the gz extension. How do I get the .dmp extension off? Will ufsrestore work on SUN system? HELP! (2 Replies)
Discussion started by: sankera
2 Replies
Login or Register to Ask a Question