Skip to content

Commit

Permalink
Merge pull request #52 from ProbablyRational/hcaz-patch-1
Browse files Browse the repository at this point in the history
Minor updates to backup script
  • Loading branch information
Alanaktion committed Feb 8, 2018
2 parents 83612e4 + 70f2b36 commit 980268a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions backup-run.php
Expand Up @@ -10,7 +10,7 @@

if(!isset($argv[2])) {
error_log("MCHostPanel Backup: No secret supplied!");
exit("No user supplied!\r\n");
exit("No secret supplied!\r\n");
}

if(!isset($argv[1])) {
Expand Down Expand Up @@ -54,14 +54,14 @@
exit('Server not running\r\n');
}

server_cmd($user['user'], "/save-all");
server_cmd($user['user'], "save-all");
//Give the server a chance to save
sleep(30);
//Prevent auto-saves while we run the backup
server_cmd($user['user'], "/save-off");
server_cmd($user['user'], "save-off");

//Notify players the world is backing up
server_cmd($user['user'], "/say [MCBackup] Starting backup...");
server_cmd($user['user'], 'tellraw @a ["",{"text":"[MCBackup]","color":"yellow"},{"text":" "},{"text":"Starting backup!","bold":true,"hoverEvent":{"action":"show_text","value":"You may experience slight performance drops while this takes place."}}]');

if(!is_dir($user['home'] . "/" . "backups")){
mkdir($user['home'] . "/" . "backups");
Expand Down Expand Up @@ -98,10 +98,10 @@
}

//Notify players the backup is done
server_cmd($user['user'], "/say [MCBackup] Backup complete");
server_cmd($user['user'], 'tellraw @a ["",{"text":"[MCBackup] ","color":"yellow"},{"text":"Backup finished!"}]');

//Turn auto-saves back on
server_cmd($user['user'], "/save-on");
server_cmd($user['user'], "save-on");

echo "MCHostPanel Backup Success\r\n";

Expand Down

0 comments on commit 980268a

Please sign in to comment.