aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2017-09-18 15:43:47 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2017-09-18 15:43:47 -0700
commit9873af5c15066ce86f18648a798573a2bb5b2819 (patch)
treebe0aabf1bb0e0962d9677f000823425d65bcf133
parentsnapshots-create: fix filename that leaked fro testing. (diff)
downloadmastermirror-scripts-9873af5c15066ce86f18648a798573a2bb5b2819.tar.gz
mastermirror-scripts-9873af5c15066ce86f18648a798573a2bb5b2819.tar.bz2
mastermirror-scripts-9873af5c15066ce86f18648a798573a2bb5b2819.zip
snapshots-create: save an entire rsync copy phase!
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
-rwxr-xr-xsnapshots-create.sh32
1 files changed, 14 insertions, 18 deletions
diff --git a/snapshots-create.sh b/snapshots-create.sh
index f60d8c6..b640fb2 100755
--- a/snapshots-create.sh
+++ b/snapshots-create.sh
@@ -108,17 +108,6 @@ if [ ! -f "${FILENAME%.bz2}" ]; then
\
>"${EXCLUSION_LIST}"
- # Build a directory of stuff to tar up.
- rm -rf portage
- rsync -Wqa \
- "$MASTER"/ \
- portage/ \
- --exclude-from "${EXCLUSION_LIST}"
- if [ $? -ne 0 ]; then
- echo "rsync run failed!"
- exit 1
- fi
-
TAR_OPTIONS=(
# GNU tar format saves approximately 1K per file in the tarball over POSIX
# format. Multiply ~170k files, and the savings are large.
@@ -131,19 +120,26 @@ if [ ! -f "${FILENAME%.bz2}" ]; then
--owner=portage
--group=portage
# Excluded content:
- # This is handled further up, by not rsyncing them at all!
- # --no-wildcards
- # --exclude-from "${EXCLUSION_LIST}"
+ --no-wildcards
+ --exclude-from "${EXCLUSION_LIST}"
# Do not capture any xattr/acl info at all.
--no-acls
--no-xattrs
--no-selinux
+ # Include a volume ID for tracing
+ -V "${FILENAME%.bz2}"
+ # do everything relative to the destination
+ -C "${MASTER}"
+ # The . needs to match the file argument
+ --transform='s,^\.,portage,g'
+ # The operation, destination, source arguments
+ --create
+ --file ${FILENAME%.bz2}
+ .
)
- tar "${TAR_OPTIONS[@]}" \
- -cf ${FILENAME%.bz2} \
- portage
+
+ tar "${TAR_OPTIONS[@]}"
rc=$?
- rm -rf portage
if [ $rc -ne 0 ]; then
echo "Tar run failed!"
exit 1