Skip to content
Snippets Groups Projects
Commit 6a04f4be authored by Christopher Gervais's avatar Christopher Gervais
Browse files

Support restic's --one-file-system option.

parent 97153e44
No related branches found
No related tags found
No related merge requests found
...@@ -32,6 +32,9 @@ exclude = ...@@ -32,6 +32,9 @@ exclude =
# This option may be specified multiple times. # This option may be specified multiple times.
tag = tag =
# Only backup files from the file systems on which the initially specified files or directories reside.
one_file_system = yes
[retention] [retention]
# Never delete the n last (most recent) snapshots # Never delete the n last (most recent) snapshots
......
...@@ -44,6 +44,7 @@ if [[ "$backup" == "yes" ]]; then ...@@ -44,6 +44,7 @@ if [[ "$backup" == "yes" ]]; then
getconf include "/etc /home /usr/local" getconf include "/etc /home /usr/local"
getconf exclude "/tmp /proc /dev /sys /net /misc /media /srv /selinux" getconf exclude "/tmp /proc /dev /sys /net /misc /media /srv /selinux"
getconf tag getconf tag
getconf one_file_system "yes"
if [ -z "$include" ]; then if [ -z "$include" ]; then
debug "No files or directories specified for backup." debug "No files or directories specified for backup."
...@@ -78,9 +79,14 @@ if [[ "$backup" == "yes" ]]; then ...@@ -78,9 +79,14 @@ if [[ "$backup" == "yes" ]]; then
done done
fi fi
if [[ "$one_file_system" == "yes" ]]; then
other_options="$other_options --one-file-system"
fi
info "Taking backup snapshot." info "Taking backup snapshot."
debug "Running: restic --repo $repo --password-file $password_file backup $tag_options $exclude_options $include_options" debug "Running: restic --repo $repo --password-file $password_file backup $other_options $tag_options $exclude_options $include_options"
restic --repo $repo --password-file $password_file backup $tag_options $exclude_options $include_options restic --repo $repo --password-file $password_file backup $other_options $tag_options $exclude_options $include_options
[ $? -ne 0 ] && fatal "restic backup failed." [ $? -ne 0 ] && fatal "restic backup failed."
else else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment