Commit 757fe617 authored by Rafael Monnerat's avatar Rafael Monnerat Committed by Cédric de Saint Martin

slaprunner: Accept custom exclude file to optimize backup.

parent 58c0b326
......@@ -67,7 +67,7 @@ mode = 0644
recipe = hexagonit.recipe.download
url = ${:_profile_base_location_}/template/runner-export.sh.jinja2
download-only = true
md5sum = 0f290b46c0b89ff84aee5c10477e07ca
md5sum = 8fd7246109783fd9267c037b079adb2a
filename = runner-export.sh.jinja2
mode = 0644
......
......@@ -7,11 +7,14 @@ sync_element () {
backup_path=$2
shift 2
element_list=$*
if [ -e {{ directory['srv'] }}/exporter.exclude ]; then
touch {{ directory['srv'] }}/exporter.exclude
fi
for element in $element_list
do
cd $path;
if [ -f $element ] || [ -d $element ]; then
{{ rsync_binary }} -rlptgov --safe-links --delete $element $backup_path;
{{ rsync_binary }} -rlptgov --safe-links --exclude-from={{ directory['srv'] }}/exporter.exclude --delete --delete-excluded $element $backup_path;
fi
done
}
......
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