Skip to content

Instantly share code, notes, and snippets.

@aoirint
Last active November 23, 2022 22:20
Show Gist options
  • Save aoirint/bea0bb8339b74b75774eda34c9e891d8 to your computer and use it in GitHub Desktop.
Save aoirint/bea0bb8339b74b75774eda34c9e891d8 to your computer and use it in GitHub Desktop.
#!/bin/bash
# mcpixelmonのバックアップデータサイズを削減するための変換スクリプト
# ゲームファイルやDynmapのキャッシュを含めていたものから、ワールドデータだけを抜き出して再圧縮する
# 所有者維持のため、root権限で実行する
set -eux
set -o pipefail
mkdir -p dest
for file in ./*.7z
do
basename=$(basename "$file")
newfile=data_world_${basename:5}
rm -rf data/
7z x "$file" data/FeedTheBeast/serverpack/world
7z a "dest/$newfile" data/FeedTheBeast/serverpack/world
done
@aoirint
Copy link
Author

aoirint commented Nov 23, 2022

削減効果(mcpixelmon)

1.54 GB -> 711 MB
2.34 GB -> 814 MB
3.05 GB -> 888 MB

total: 32.7 GB -> 10.2 GB


削減効果(biome)

total: 6.44 GB -> 1.80 GB

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment