Commit 90232637 authored by Cédric Le Ninivin's avatar Cédric Le Ninivin

runner: update backup script (take all configuration files in .*)

runner: fix export of hidden files

runner.backup: segregation is enforced for hidden files

runner.backup: not one option to rule all rsync

runner.backup: forget rsync for hidden files use cp

runner: fix resiliency import script
parent e4f776a6
......@@ -71,7 +71,9 @@ class ExportRecipe(GenericBaseRecipe):
done
}
sync_element %(srv-directory)s/runner %(backup-directory)s/runner/ instance project proxy.db
sync_element %(etc-directory)s %(backup-directory)s/etc/ .rcode .project .users .htpasswd config.json ssh
# We sync .* appart
cp -r %(etc-directory)s/.??* %(backup-directory)s/etc/
sync_element %(etc-directory)s %(backup-directory)s/etc/ config.json ssh
if [ -d %(backup-directory)s/runner/software ]; then
rm %(backup-directory)s/runner/software/*
fi
......@@ -120,14 +122,9 @@ class ImportRecipe(GenericBaseRecipe):
done
}
restore_element %(backup-directory)s/runner/ %(srv-directory)s/runner instance project proxy.db
restore_element %(backup-directory)s/etc/ %(etc-directory)s .rcode .project .users .htpasswd config.json ssh
ifs=$IFS IFS=';'
read user pass remaining < %(etc-directory)s/.users
IFS=$ifs
%(curl-binary)s --insecure -vg6L -F clogin="$user" -F cpwd="$pass" --dump-header login_cookie %(backend-url)s/doLogin;
%(curl-binary)s --insecure -vg6L --cookie login_cookie --max-time 5 %(backend-url)s/isSRReady;
%(curl-binary)s --insecure -vg6LX POST --cookie login_cookie --max-time 5 %(backend-url)s/runSoftwareProfile --user "$user":"$pass";
rm -f login_cookie
restore_element %(backup-directory)s/etc/ %(etc-directory)s config.json ssh
cp -r %(backup-directory)s/etc/.??* %(etc-directory)s;
%(curl-binary)s --insecure -vg6L --max-time 5 %(backend-url)s/isSRReady;
""" % self.options)
self.createExecutable(wrapper, content=content)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment