Merge branch 'erp5-component' into erp5
[slapos.git] / software / slaprunner / template / runner-export.sh.jinja2
1 #!{{ shell_binary }}
2 umask 077
3 sync_element () {
4   path=$1
5   backup_path=$2
6   shift 2
7   element_list=$*
8   for element in $element_list
9   do
10     cd $path;
11     if [ -f $element ] || [ -d $element ]; then
12        {{ rsync_binary }} -avz --safe-links --delete $element  $backup_path;
13     fi
14   done
15 }
16 sync_element {{ directory['srv'] }}/runner  {{ directory['backup'] }}/runner/ instance project  proxy.db
17 # We sync .* appart
18 date +%s -u > {{ directory['etc'] }}/.resilient-timestamp
19 cp -r {{ directory['etc'] }}/.??* {{ directory['backup'] }}/etc/
20 sync_element {{ directory['etc'] }}  {{ directory['backup'] }}/etc/ config.json ssh
21 if [ -d {{ directory['backup'] }}/runner/software ]; then
22   rm {{ directory['backup'] }}/runner/software/*
23 fi