forked from evolix/evocheck
IS_EVOBACKUP_EXCLUDE_MOUNT : skip if --one-file-system is used
This commit is contained in:
parent
b92d81fd91
commit
3694b364d3
|
@ -7,6 +7,8 @@ and this project **does not adhere to [Semantic Versioning](http://semver.org/sp
|
|||
|
||||
### Changed
|
||||
|
||||
* IS_EVOBACKUP_EXCLUDE_MOUNT : skip if --one-file-system is used
|
||||
|
||||
### Deprecated
|
||||
|
||||
### Removed
|
||||
|
|
|
@ -601,7 +601,11 @@ check_evobackup_exclude_mount() {
|
|||
|
||||
# shellcheck disable=SC2044
|
||||
for evobackup_file in $(find /etc/cron* -name '*evobackup*' | grep -v -E ".disabled$"); do
|
||||
grep -- "--exclude " "${evobackup_file}" | grep -E -o "\"[^\"]+\"" | tr -d '"' > "${excludes_file}"
|
||||
# If rsync is not limited by "one-file-system"
|
||||
# then we verify that every mount is excluded
|
||||
grep -q -- "^\s*--one-file-system" "${evobackup_file}" \
|
||||
|| grep -- "--exclude " "${evobackup_file}" | grep -E -o "\"[^\"]+\"" | tr -d '"' \
|
||||
> "${excludes_file}"
|
||||
not_excluded=$(findmnt --type nfs,nfs4,fuse.sshfs, -o target --noheadings | grep -v -f "${excludes_file}")
|
||||
for mount in ${not_excluded}; do
|
||||
failed "IS_EVOBACKUP_EXCLUDE_MOUNT" "${mount} is not excluded from ${evobackup_file} backup script"
|
||||
|
|
Loading…
Reference in a new issue