diff --git a/japanpost/gen.sh b/japanpost/gen.sh index 153b0b046..f5061161b 100755 --- a/japanpost/gen.sh +++ b/japanpost/gen.sh @@ -33,4 +33,7 @@ rm -rf "$TARGET_DIR" && tar -xzf "$WORK_DIR/jp.tar.gz" -C "$WORK_DIR" ## Pack with a relative path so the archive stays rooted at jp/ (s3_sync.sh ## extracts it and runs `aws s3 sync jp/`, which needs a top-level jp/ entry). -tar -C "$WORK_DIR" -czf "$WORK_DIR/jp.tar.gz" jp +## COPYFILE_DISABLE=1 stops macOS tar from adding AppleDouble (._*) members and +## xattr headers; otherwise GNU tar on Linux extracts the ._* files and they get +## synced to S3 as junk (doubling the upload). +COPYFILE_DISABLE=1 tar -C "$WORK_DIR" -czf "$WORK_DIR/jp.tar.gz" jp diff --git a/jp.tar.gz b/jp.tar.gz index 4a1267619..5732d4246 100644 Binary files a/jp.tar.gz and b/jp.tar.gz differ diff --git a/s3_sync.sh b/s3_sync.sh index 850ed838b..07fc0db23 100755 --- a/s3_sync.sh +++ b/s3_sync.sh @@ -9,4 +9,4 @@ fi; echo "BUCKET $BUCKET" echo "COUNTRY $COUNTRY" -tar -xzf ./$COUNTRY.tar.gz && aws s3 sync $COUNTRY/ s3://$BUCKET/$COUNTRY/ --exclude "*" --include "*.json" +tar -xzf ./$COUNTRY.tar.gz && aws s3 sync $COUNTRY/ s3://$BUCKET/$COUNTRY/ --exclude "*" --include "*.json" --exclude "._*"