25 lines
1.3 KiB
Bash
Executable file
25 lines
1.3 KiB
Bash
Executable file
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
SRC="/mnt/bigdisk/_/last-linux-backup/applications/src/@egirl/egirl-platform"
|
|
CACHE_DIR="${HOME}/.cache/cocottetech-archives"
|
|
OUT="${CACHE_DIR}/platform.0.tar.zst"
|
|
ZSTD_LEVEL="${ZSTD_LEVEL:-3}"
|
|
EXCLUDES=(
|
|
--exclude='.git' --exclude='.gitlab-ci-local' --exclude='.playwright-mcp'
|
|
--exclude='.turbo' --exclude='.next' --exclude='dist' --exclude='build' --exclude='out'
|
|
--exclude='node_modules' --exclude='.pnpm-store' --exclude='.yarn/cache' --exclude='.cache'
|
|
--exclude='ml-service' --exclude='models' --exclude='checkpoints' --exclude='weights'
|
|
--exclude='training/data' --exclude='training_data' --exclude='captcha-solver'
|
|
--exclude='*.gguf' --exclude='*.safetensors' --exclude='*.bin' --exclude='*.ckpt'
|
|
--exclude='*.pth' --exclude='*.pt' --exclude='*.onnx' --exclude='*.h5'
|
|
--exclude='*.mp4' --exclude='*.mov' --exclude='*.webm' --exclude='*.zip'
|
|
--exclude='*.tar.gz' --exclude='*.tar.zst'
|
|
)
|
|
[ -d "$SRC" ] || { echo "missing: $SRC"; exit 1; }
|
|
mkdir -p "$CACHE_DIR"
|
|
[ -f "$OUT" ] && { echo "cache exists: $OUT (skipping rebuild)"; exit 0; }
|
|
echo "building v0 from $SRC (NFS) -> $OUT"
|
|
before=$(date +%s)
|
|
tar "${EXCLUDES[@]}" -cf - -C "$(dirname "$SRC")" "$(basename "$SRC")" | zstd -"$ZSTD_LEVEL" -T0 -o "$OUT"
|
|
after=$(date +%s)
|
|
echo "done in $((after - before))s, size: $(du -h "$OUT" | cut -f1)"
|