Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 82 lines (78 sloc) 3.73 kb
c7a3552 two new tools for dumping and diffing clc dbs
Daniel Nurmi authored
1 #!/bin/bash
df1fb37 @gholms Update GPL file headers
gholms authored
2
3 # Copyright 2009-2012 Eucalyptus Systems, Inc.
4 #
5 # This program is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; version 3 of the License.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see http://www.gnu.org/licenses/.
16 #
17 # Please contact Eucalyptus Systems, Inc., 6755 Hollister Ave., Goleta
18 # CA 93117, USA or visit http://www.eucalyptus.com/licenses/ if you need
19 # additional information or have any questions.
47b5fb5 @gholms Tweak GPL headers
gholms authored
20 #
21 # This file may incorporate work covered under the following copyright
22 # and permission notice:
23 #
24 # Software License Agreement (BSD License)
25 #
26 # Copyright (c) 2008, Regents of the University of California
27 # All rights reserved.
28 #
29 # Redistribution and use of this software in source and binary forms,
30 # with or without modification, are permitted provided that the
31 # following conditions are met:
32 #
33 # Redistributions of source code must retain the above copyright
34 # notice, this list of conditions and the following disclaimer.
35 #
36 # Redistributions in binary form must reproduce the above copyright
37 # notice, this list of conditions and the following disclaimer
38 # in the documentation and/or other materials provided with the
39 # distribution.
40 #
41 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
42 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
43 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
44 # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
45 # COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
46 # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
47 # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
48 # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
49 # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
50 # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
51 # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
52 # POSSIBILITY OF SUCH DAMAGE. USERS OF THIS SOFTWARE ACKNOWLEDGE
53 # THE POSSIBLE PRESENCE OF OTHER OPEN SOURCE LICENSED MATERIAL,
54 # COPYRIGHTED MATERIAL OR PATENTED MATERIAL IN THIS SOFTWARE,
55 # AND IF ANY SUCH MATERIAL IS DISCOVERED THE PARTY DISCOVERING
56 # IT MAY INFORM DR. RICH WOLSKI AT THE UNIVERSITY OF CALIFORNIA,
57 # SANTA BARBARA WHO WILL THEN ASCERTAIN THE MOST APPROPRIATE REMEDY,
58 # WHICH IN THE REGENTS' DISCRETION MAY INCLUDE, WITHOUT LIMITATION,
59 # REPLACEMENT OF THE CODE SO IDENTIFIED, LICENSING OF THE CODE SO
60 # IDENTIFIED, OR WITHDRAWAL OF THE CODE CAPABILITY TO THE EXTENT
61 # NEEDED TO COMPLY WITH ANY SUCH LICENSES OR RIGHTS.
df1fb37 @gholms Update GPL file headers
gholms authored
62
c7a3552 two new tools for dumping and diffing clc dbs
Daniel Nurmi authored
63 D=`date | sed "s/ //g"`
64 HOST1=$1
65 if [ -z "$HOST1" ]; then
66 HOST1="127.0.0.1"
67 fi
68 HOST2=$2
69 if [ -z "$HOST2" ]; then
70 HOST2="127.0.0.1"
71 fi
72 mkdir -p /tmp/$D
73 DBPASS=`./dbPass.sh`
c8277ed @grze handle centos dbdump, individual inserts
grze authored
74 if ( ! mysqldump --all-databases -u eucalyptus --password="$DBPASS" --port=8777 --protocol=TCP --host=$HOST1 --skip-extended-insert --skip-opt --lock-tables=false > /tmp/$D/db.$HOST1 2>/dev/null ); then
c7a3552 two new tools for dumping and diffing clc dbs
Daniel Nurmi authored
75 rm -f /tmp/$D/db.$HOST1
76 fi
77
c8277ed @grze handle centos dbdump, individual inserts
grze authored
78 if ( ! mysqldump --all-databases -u eucalyptus --password="$DBPASS" --port=8777 --protocol=TCP --host=$HOST2 --skip-extended-insert --skip-opt --lock-tables=false > /tmp/$D/db.$HOST2 2>/dev/null ); then
c7a3552 two new tools for dumping and diffing clc dbs
Daniel Nurmi authored
79 rm -f /tmp/$D/db.$HOST2
80 fi
d696f24 @grze handle centos dbdump, individual inserts
grze authored
81 echo "/tmp/$D $HOST1 $HOST2"
Something went wrong with that request. Please try again.