innobackupx_scripted_to_backup_daily
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
innobackupx_scripted_to_backup_daily [2011/03/02 01:19] – created k2patel | innobackupx_scripted_to_backup_daily [2020/08/10 02:35] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 5: | Line 5: | ||
* Following script need you to change some variables.\\ | * Following script need you to change some variables.\\ | ||
- | == **Master server** == | + | == Master server == |
<code bash | / | <code bash | / | ||
Line 12: | Line 12: | ||
if / | if / | ||
then | then | ||
- | if ssh root@remote.backup.com "/usr/local/ | + | if ssh root@remote.backup.com "/ |
then | then | ||
echo " | echo " | ||
Line 21: | Line 21: | ||
echo " | echo " | ||
fi | fi | ||
+ | </ | ||
+ | |||
+ | == Remote Server == | ||
+ | |||
+ | <code bash | / | ||
+ | #!/bin/bash | ||
+ | |||
+ | cd / | ||
+ | if tar -ixvf test.tar | ||
+ | then | ||
+ | / | ||
+ | /bin/sleep 20 | ||
+ | if ps awux | grep -v grep | grep mysqld | ||
+ | then | ||
+ | exit $? | ||
+ | else | ||
+ | echo "mysql stopped" | ||
+ | fi | ||
+ | if rm -rf / | ||
+ | then | ||
+ | echo " | ||
+ | if / | ||
+ | then | ||
+ | echo "copy back done" | ||
+ | if chown -R mysql:mysql / | ||
+ | then | ||
+ | echo " | ||
+ | /bin/sleep 20 | ||
+ | / | ||
+ | /bin/sleep 20 | ||
+ | if ps awux | grep -v grep | grep mysqld | ||
+ | then | ||
+ | echo "mysql started" | ||
+ | else | ||
+ | exit $? | ||
+ | fi | ||
+ | if / | ||
+ | then | ||
+ | echo " | ||
+ | if rm -rf / | ||
+ | then | ||
+ | echo " | ||
+ | exit $? | ||
+ | else | ||
+ | echo " | ||
+ | exit $? | ||
+ | fi | ||
+ | else | ||
+ | echo " | ||
+ | exit $? | ||
+ | fi | ||
+ | else | ||
+ | echo " | ||
+ | exit $? | ||
+ | fi | ||
+ | else | ||
+ | echo "Filed on Copy Back" | mail -s " | ||
+ | exit $? | ||
+ | fi | ||
+ | else | ||
+ | echo " | ||
+ | exit $? | ||
+ | fi | ||
+ | fi | ||
+ | else | ||
+ | echo " | ||
+ | fi | ||
+ | </ | ||
innobackupx_scripted_to_backup_daily.1299028759.txt.gz · Last modified: 2020/08/10 02:30 (external edit)