Add the rsync commands to the configuration file

This file is then send to the server, so BackupPC directly interpreter
it.
This commit is contained in:
Jeremy Gardais 2018-04-25 16:41:08 +02:00
parent 4cf4e0dccb
commit c1881635a1
Signed by: jegardai
GPG Key ID: E759BAA22501AF32
1 changed files with 5 additions and 2 deletions

View File

@ -262,9 +262,10 @@ exclude="['ownCloud','.local/share/Trash','.cache','.Play*','.steam','.wine','Pe
echo "\$Conf{XferMethod} = 'rsync';" > "${filepl}" echo "\$Conf{XferMethod} = 'rsync';" > "${filepl}"
echo "\$Conf{RsyncShareName} = [${directories}];" >> "${filepl}" echo "\$Conf{RsyncShareName} = [${directories}];" >> "${filepl}"
echo "\$Conf{BackupFilesExclude} = {'*' => ${exclude} };" >> "${filepl}" echo "\$Conf{BackupFilesExclude} = {'*' => ${exclude} };" >> "${filepl}"
printf '\e[1;33m%-6s\e[m\n' "Fichier de configuration créé (${filepl})" printf '\e[1;33m%-6s\e[m\n' "DEBUG: Fichier de configuration créé (${filepl})"
#### LE SERVEUR DOIT CONNAITRE #### #### LE SERVEUR DOIT CONNAITRE ####
# Les commandes à exécuter avec sudo
# ssh_host_ecdsa_key.pub DU CLIENT # ssh_host_ecdsa_key.pub DU CLIENT
# LADRESSE MAIL # LADRESSE MAIL
# L'IP # L'IP
@ -274,8 +275,10 @@ printf '\e[1;35m%-6s\e[m\n' "DEBUG: Partie - Informations complémentaires da
printf '\e[1;34m%-6s\e[m' "Votre adresse e-mail : " printf '\e[1;34m%-6s\e[m' "Votre adresse e-mail : "
read input_mail read input_mail
echo "# host:${fqdn}" >> "${filepl}" echo "\$Conf{RsyncClientCmd} = '\$sshPath -q -x -l backuppc \$host sudo \$rsyncPath \$argList+';" >> "${filepl}"
echo "\$Conf{RsyncClientRestoreCmd} = '\$sshPath -q -x -l backuppc \$host sudo \$rsyncPath \$argList+';" >> "${filepl}"
echo "# host:${fqdn}" >> "${filepl}"
cmd_hostkey=$(cat "${hostkey}") cmd_hostkey=$(cat "${hostkey}")
echo "# hostkey:${cmd_hostkey}" >> "${filepl}" echo "# hostkey:${cmd_hostkey}" >> "${filepl}"
echo "# mail:${input_mail}" >> "${filepl}" echo "# mail:${input_mail}" >> "${filepl}"