28 lines
1.9 KiB
PowerShell
28 lines
1.9 KiB
PowerShell
# Uploads an extracted UGC avatar pack to the VPS staging folder, in one shot:
|
|
# 1. tar the pack folder (no compression - bundles are already compressed) to D:\Puck\avatar-pack.tar
|
|
# 2. pscp the tar to /root/ on the VPS
|
|
# 3. extract it into /opt/campus/Data/AvatarImportStaging and delete the tar
|
|
# Then import it from the admin panel (POST /admin/api/import_avatar_staging) or ask Claude to.
|
|
# Run detached (this takes ~40 min for 25 GB); progress goes to $Log.
|
|
param(
|
|
[string]$Pack = "D:\Puck\Campus2025Server-2025\Server\2025-RecRoom-Server-E12354-main\Data\CDN\AvatarBlobs\1",
|
|
[string]$Log = "D:\Puck\avatar-pack-upload.log"
|
|
)
|
|
$ErrorActionPreference = "Continue"
|
|
$pw = (Get-Content "D:\Puck\Campus2025Server-2025\Password.txt" -Raw).Trim()
|
|
$tar = "D:\Puck\avatar-pack.tar"
|
|
"$(Get-Date -Format u) start pack=$Pack" | Out-File $Log -Encoding utf8
|
|
|
|
"$(Get-Date -Format u) [1/3] tar ..." | Out-File $Log -Append -Encoding utf8
|
|
if (Test-Path $tar) { Remove-Item $tar -Force }
|
|
& tar -cf $tar -C (Split-Path $Pack) (Split-Path $Pack -Leaf) 2>> $Log
|
|
"$(Get-Date -Format u) tar exit=$LASTEXITCODE size=$((Get-Item $tar).Length)" | Out-File $Log -Append -Encoding utf8
|
|
|
|
"$(Get-Date -Format u) [2/3] pscp ..." | Out-File $Log -Append -Encoding utf8
|
|
& pscp -batch -q -pw $pw $tar root@50.114.179.17:/root/avatar-pack.tar 2>> $Log
|
|
"$(Get-Date -Format u) pscp exit=$LASTEXITCODE" | Out-File $Log -Append -Encoding utf8
|
|
|
|
"$(Get-Date -Format u) [3/3] extract on VPS ..." | Out-File $Log -Append -Encoding utf8
|
|
& plink -batch -pw $pw root@50.114.179.17 "mkdir -p /opt/campus/Data/AvatarImportStaging && tar -xf /root/avatar-pack.tar -C /opt/campus/Data/AvatarImportStaging && rm -f /root/avatar-pack.tar && echo EXTRACT_OK && du -sh /opt/campus/Data/AvatarImportStaging && df -h / | tail -1" 2>&1 | Out-File $Log -Append -Encoding utf8
|
|
"$(Get-Date -Format u) DONE" | Out-File $Log -Append -Encoding utf8
|