Skip to content

Instantly share code, notes, and snippets.

@stuntguy3000
Created May 22, 2019 13:47
Show Gist options
  • Save stuntguy3000/fc2f1ee1d2012da43d8339c8a7c2d027 to your computer and use it in GitHub Desktop.
Save stuntguy3000/fc2f1ee1d2012da43d8339c8a7c2d027 to your computer and use it in GitHub Desktop.
Minecraft Server Backup n Boot Script
Add-Type -Assembly "System.IO.Compression.FileSystem"
$dir = Get-Location
$path = $dir.tostring()
while (1) {
$dateObject = Get-Date
$uniqueID = "Vanilla Survival AutoSave $($dateObject.Hour)-$($dateObject.Minute)-$($dateObject.Second ) ($($dateObject.Day)-$($dateObject.Month)-$($dateObject.Year))"
mkdir "AutoSave\$($uniqueID)"
xcopy ".\world" "AutoSave\$($uniqueID)" /e
[System.IO.Compression.ZipFile]::CreateFromDirectory("$path\AutoSave\$($uniqueID)", "$path\AutoSave\$($uniqueID).zip");
java -jar -DIReallyKnowWhatIAmDoingISwear spigot-1.12-R0.1-SNAPSHOT-b1346.jar nogui
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment