modifying backup script to include remote db
Posted: Mon Apr 04, 2016 2:53 pm
hello guys!
Quick question:
why is it snowing in mass in spring????? lol ok ok the real question:
I have moved my db to a remote server using the instructions found here (this is xi ver 1024 which still uses postgresql):
now I want to modify the script found in:
so that it pulls the remote db into the backup.
I modified the lines
and
to
and
that should work right? a little scared to run it before I make sure it wont mess anything up =D
Quick question:
why is it snowing in mass in spring????? lol ok ok the real question:
I have moved my db to a remote server using the instructions found here (this is xi ver 1024 which still uses postgresql):
Code: Select all
https://assets.nagios.com/downloads/nagiosxi/docs/Offloading_MySQL_to_Remote%20Server.pdfCode: Select all
/usr/local/nagiosxi/scripts/backup_xi.shI modified the lines
Code: Select all
mysqldump -h $cfg__db_info__ndoutils__dbserver -u $cfg__db_info__ndoutils__user --password="$cfg__db_info__ndoutils__pwd" --add-drop-database -B $cfg__db_info__ndoutils__db > $mydir/mysql/nagios.sql
res=$?Code: Select all
mysqldump -h $cfg__db_info__nagiosql__dbserver -u $cfg__db_info__nagiosql__user --password="$cfg__db_info__nagiosql__pwd" --add-drop-database -B $cfg__db_info__nagiosql__db > $mydir/mysql/nagiosql.sql
res=$?Code: Select all
mysqldump -h [b]REMOTEDB LOCATION[/b] $cfg__db_info__ndoutils__dbserver -u $cfg__db_info__ndoutils__user --password="$cfg__db_info__ndoutils__pwd" --add-drop-database -B $cfg__db_info__ndoutils__db > $mydir/mysql/nagios.sql
res=$?Code: Select all
mysqldump -h [b]REMOTEDB LOCATION[/b] $cfg__db_info__nagiosql__dbserver -u $cfg__db_info__nagiosql__user --password="$cfg__db_info__nagiosql__pwd" --add-drop-database -B $cfg__db_info__nagiosql__db > $mydir/mysql/nagiosql.sql
res=$?