Implement ignore rules in restic
This commit is contained in:
parent
bfce95d50d
commit
834f40d3ad
@ -59,6 +59,14 @@ backup() {
|
|||||||
# we can script around it.
|
# we can script around it.
|
||||||
/opt/restic-wrapper \
|
/opt/restic-wrapper \
|
||||||
--verbose \
|
--verbose \
|
||||||
|
{% for item in backup_s3backup_exclude_list + backup_s3backup_exclude_list_extra %}
|
||||||
|
--exclude="{{ item }}" \
|
||||||
|
{% endfor %}
|
||||||
|
--exclude="/data/**/backup" \
|
||||||
|
--exclude="/data/**/backups" \
|
||||||
|
--exclude="*.bak" \
|
||||||
|
--exclude="*.tmp" \
|
||||||
|
--exclude="*.swp" \
|
||||||
backup \
|
backup \
|
||||||
"$@"
|
"$@"
|
||||||
# In addition, we should also prune our backups
|
# In addition, we should also prune our backups
|
||||||
@ -129,12 +137,7 @@ if [ -n "${DIRS[*]}" ]; then
|
|||||||
for dir in "${DIRS[@]}"; do
|
for dir in "${DIRS[@]}"; do
|
||||||
echo "- $dir"
|
echo "- $dir"
|
||||||
done
|
done
|
||||||
if command -v restic > /dev/null 2>&1; then
|
echo "Will ignore the following items:"
|
||||||
echo "An ignore list was specified, but restic was detected as the backup method."
|
|
||||||
echo "The following list of items WILL be backed up:"
|
|
||||||
else
|
|
||||||
echo "Will ignore the following items:"
|
|
||||||
fi
|
|
||||||
{% for item in backup_s3backup_exclude_list + backup_s3backup_exclude_list_extra %}
|
{% for item in backup_s3backup_exclude_list + backup_s3backup_exclude_list_extra %}
|
||||||
echo "- {{ item }}"
|
echo "- {{ item }}"
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user