|
@@ -88,6 +88,10 @@ function backup_local_synapse {
|
88
|
88
|
systemctl stop synapse
|
89
|
89
|
function_check backup_directory_to_usb
|
90
|
90
|
backup_directory_to_usb $source_directory synapse
|
|
91
|
+ source_directory=/var/lib/matrix-synapse
|
|
92
|
+ if [ -d $source_directory ]; then
|
|
93
|
+ backup_directory_to_usb $source_directory synapsedata
|
|
94
|
+ fi
|
91
|
95
|
systemctl start synapse
|
92
|
96
|
fi
|
93
|
97
|
}
|
|
@@ -108,6 +112,17 @@ function restore_local_synapse {
|
108
|
112
|
rm -rf $temp_restore_dir
|
109
|
113
|
chown -R synapse:synapse $SYNAPSE_DIR
|
110
|
114
|
|
|
115
|
+ temp_restore_dir=/root/tempsynapsedata
|
|
116
|
+ restore_directory_from_usb $temp_restore_dir synapsedata
|
|
117
|
+ cp -r $temp_restore_dir/var/lib/matrix-synapse/* /var/lib/matrix-synapse
|
|
118
|
+ if [ ! "$?" = "0" ]; then
|
|
119
|
+ function_check backup_unmount_drive
|
|
120
|
+ backup_unmount_drive
|
|
121
|
+ exit 36872
|
|
122
|
+ fi
|
|
123
|
+ rm -rf $temp_restore_dir
|
|
124
|
+ chown -R synapse:synapse /var/lib/matrix-synapse
|
|
125
|
+
|
111
|
126
|
systemctl start synapse
|
112
|
127
|
fi
|
113
|
128
|
}
|
|
@@ -118,6 +133,10 @@ function backup_remote_synapse {
|
118
|
133
|
systemctl stop synapse
|
119
|
134
|
function_check backup_directory_to_friend
|
120
|
135
|
backup_directory_to_friend $source_directory synapse
|
|
136
|
+ source_directory=/var/lib/matrix-synapse
|
|
137
|
+ if [ -d $source_directory ]; then
|
|
138
|
+ backup_directory_to_friend $source_directory synapsedata
|
|
139
|
+ fi
|
121
|
140
|
systemctl start synapse
|
122
|
141
|
fi
|
123
|
142
|
}
|
|
@@ -131,11 +150,20 @@ function restore_remote_synapse {
|
131
|
150
|
restore_directory_from_friend $temp_restore_dir synapse
|
132
|
151
|
cp -r $temp_restore_dir$SYNAPSE_DIR/* $SYNAPSE_DIR
|
133
|
152
|
if [ ! "$?" = "0" ]; then
|
134
|
|
- exit 725
|
|
153
|
+ exit 59262
|
135
|
154
|
fi
|
136
|
155
|
rm -rf $temp_restore_dir
|
137
|
156
|
chown -R synapse:synapse $SYNAPSE_DIR
|
138
|
157
|
|
|
158
|
+ temp_restore_dir=/root/tempsynapsedata
|
|
159
|
+ restore_directory_from_friend $temp_restore_dir synapsedata
|
|
160
|
+ cp -r $temp_restore_dir/var/lib/matrix-synapse/* /var/lib/matrix-synapse
|
|
161
|
+ if [ ! "$?" = "0" ]; then
|
|
162
|
+ exit 78335
|
|
163
|
+ fi
|
|
164
|
+ rm -rf $temp_restore_dir
|
|
165
|
+ chown -R synapse:synapse /var/lib/matrix-synapse
|
|
166
|
+
|
139
|
167
|
systemctl start synapse
|
140
|
168
|
fi
|
141
|
169
|
}
|