Fixing zbackup command on Minecraft Backup

This commit is contained in:
Bruno F. Fontes 2020-05-24 11:11:07 -03:00
parent 35ed6782e6
commit 32671c4624
Signed by: brunofontes
GPG Key ID: EE3447CE80048495
2 changed files with 13 additions and 2 deletions

View File

@ -50,8 +50,8 @@ done
BACKUPDATE=$(date +"%Y-%m-%d_%H-%M-%S") BACKUPDATE=$(date +"%Y-%m-%d_%H-%M-%S")
mkdir "$BACKUPDIR/$BACKUPDATE" mkdir "$BACKUPDIR/$BACKUPDATE"
/bin/tar c --exclude=behavior_packs/* --exclude=resource_packs/* "$SURVIVALDIR/worlds/Survival" | zbackup --nonencrypted backup "$BACKUPDIR/$BACKUPDATE-Survival" /bin/tar c --exclude=behavior_packs/* --exclude=resource_packs/* "$SURVIVALDIR/worlds/Survival" | zbackup --non-encrypted backup "$BACKUPDIR/$BACKUPDATE-Survival"
/bin/tar c --exclude=behavior_packs/* --exclude=resource_packs/* "$CREATIVEDIR/worlds/Creative" | zbackup --nonencrypted backup "$BACKUPDIR/$BACKUPDATE-Creative" /bin/tar c --exclude=behavior_packs/* --exclude=resource_packs/* "$CREATIVEDIR/worlds/Creative" | zbackup --non-encrypted backup "$BACKUPDIR/$BACKUPDATE-Creative"
runAllWorlds "^u" runAllWorlds "^u"
runAllWorlds "save resume\n" runAllWorlds "save resume\n"

11
Services/minecraft-stop.service Executable file
View File

@ -0,0 +1,11 @@
[Unit]
Description=Properly shutdown Minecraft before PC shutdown
[Service]
Type=oneshot
RemainAfterExit=true
User=bruno
ExecStop=/bin/sh /home/bruno/Apps/Minecraft/stopServers.sh
[Install]
WantedBy=multi-user.target