Created
May 22, 2019 13:47
-
-
Save stuntguy3000/fc2f1ee1d2012da43d8339c8a7c2d027 to your computer and use it in GitHub Desktop.
Minecraft Server Backup n Boot Script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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