Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if [ "$1" = "etc" ]; then
- rsync ${RSYNCOPTS} "${srcetc}" "${buetc}"
- if [ "$2" = "verify" ]; then
- echo "Überprüfe Backup - bitte warten"
- temp_file="$(mktemp)"
- ### create hashes for files in source
- pushd "${srcetc}"
- find -H ./ -xdev -type f -exec md5sum -b -- '{}' '+' 1>"${temp_file}" 2>'/dev/null'
- popd
- ### compare to hashes in destination
- pushd "${buetc}"
- if md5sum -c "${temp_file}"; then
- rm -- ${temp_file}
- else
- echo "Retaining checksum file \"${temp_file}\"."
- fi
- popd
- fi
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement