Merge pull request #102 from zamentur/unstable

[fix] Backup of mysql and slapd
This commit is contained in:
Zamentur aka ljf 2015-10-02 23:23:07 +02:00
commit 20946bb47d
4 changed files with 14 additions and 5 deletions

View file

@ -1,7 +1,15 @@
backup_dir="$1/conf/ldap"
mkdir -p $backup_dir
# Fix for first jessie yunohost where slapd.conf is called slapd-yuno.conf
# without slapcat doesn't work
if [ ! -f /etc/ldap/slapd.conf ]
then
sudo mv /etc/ldap/slapd-yuno.conf /etc/ldap/slapd.conf
fi
sudo cp -a /etc/ldap/slapd.conf $backup_dir/
sudo slapcat -l $backup_dir/slapcat.ldif.raw
egrep -v "^entryCSN:" < $backup_dir/slapcat.ldif.raw > $backup_dir/slapcat.ldif
rm -f $backup_dir/slapcat.ldif.raw

View file

@ -1,4 +0,0 @@
backup_dir="$1/conf/mysql"
mkdir -p $backup_dir
mysqlpwd=$(sudo cat /etc/yunohost/mysql)

View file

@ -0,0 +1,4 @@
backup_dir="$1/conf/ynh/mysql"
mkdir -p $backup_dir
sudo cp -a /etc/yunohost/mysql $backup_dir/

View file

@ -1,5 +1,6 @@
backup_dir="$1/conf/mysql"
backup_dir="$1/conf/ynh/mysql"
service mysql restart
sudo cp -a $backup_dir/mysql /etc/yunohost/mysql
mysqlpwd=$(sudo cat /etc/yunohost/mysql)
sudo mysqladmin flush-privileges -p"$mysqlpwd"