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
......
......