diff options
author | 2017-09-18 15:06:05 -0700 | |
---|---|---|
committer | 2017-09-18 15:06:05 -0700 | |
commit | 283ce5efe4e8381fc2f319bd5b9bbeb2d5fd6b5f (patch) | |
tree | 7236fbeffe3a0f1417788e1dea932f99e6ac4ec0 /snapshots-create.sh | |
parent | snapshots-create: improved tar arguments (diff) | |
download | mastermirror-scripts-283ce5efe4e8381fc2f319bd5b9bbeb2d5fd6b5f.tar.gz mastermirror-scripts-283ce5efe4e8381fc2f319bd5b9bbeb2d5fd6b5f.tar.bz2 mastermirror-scripts-283ce5efe4e8381fc2f319bd5b9bbeb2d5fd6b5f.zip |
snapshots-create: exclude some content from the rsync, better than exclusion during tar
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
Diffstat (limited to 'snapshots-create.sh')
-rwxr-xr-x | snapshots-create.sh | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/snapshots-create.sh b/snapshots-create.sh index 9b2cbe7..66873fa 100755 --- a/snapshots-create.sh +++ b/snapshots-create.sh @@ -85,11 +85,35 @@ cd ${TEMP} # create the tarball and move it to the right location write_time_log "START TARBALL $(date -u)" if [ ! -f "${FILENAME%.bz2}" ]; then + # Build exclusion list + # app-bar/ChangeLog is a valid package name, so we have to be careful about it! + EXCLUSION_LIST="$(mktemp -p ${TEMP} snapshot-exclude.XXXXXXXXXX)" + find "${MASTER}" \ + \( \ + -type f \ + -regextype posix-egrep \ + \( \ + -path "${MASTER}/eclass/ChangeLog*" -o \ + -path "${MASTER}/profiles/ChangeLog*" -o \ + -path "${MASTER}/profiles/*/ChangeLog*" -o \ + -regex "${MASTER}/[^/]+/[^/]+/ChangeLog(-[0-9]+)?$" \ + \) \ + \) \ + -o \ + -name '.checksum-test-marker' \ + \ + | sed "s,${MASTER}/*,,g" \ + \ + | sort \ + \ + >"${EXCLUSION_LIST}" + # Build a directory of stuff to tar up. rm -rf portage rsync -Wqa \ "$MASTER"/ \ - portage/ + portage/ \ + --exclude-from "${EXCLUSION_LIST}" if [ $? -ne 0 ]; then echo "rsync run failed!" exit 1 |