Added path checks and updated config
- Cleaned up func main() - Separated config into two sections server and factoryman - Updated backup.go to reflect changes to config file - Updated config.go to reflect changes to config.yml as well as added a check to paths in config.yml - Updated launch.go to reflect changes to config move cli handler from main to cli.go
This commit is contained in:
@@ -13,8 +13,8 @@ func backUp(cmd string, c GoConfig) {
|
||||
fmt.Println("Starting full server backup")
|
||||
t := time.Now()
|
||||
timeStamp := t.Format(time.RFC3339)
|
||||
fullBackupName := fmt.Sprintf("%s/ServerBackup.%s.tgz", c.Config.BackupDir, timeStamp)
|
||||
fullBackup := exec.Command("tar", "-czvf", fullBackupName, c.Config.ServDir)
|
||||
fullBackupName := fmt.Sprintf("%s/ServerBackup.%s.tgz", c.Factoryman.BackupDir, timeStamp)
|
||||
fullBackup := exec.Command("tar", "-czvf", fullBackupName, c.Server.ServDir)
|
||||
fullBackup.Stdout = os.Stdout
|
||||
err := fullBackup.Run()
|
||||
if err != nil {
|
||||
@@ -24,8 +24,8 @@ func backUp(cmd string, c GoConfig) {
|
||||
fmt.Println("Backing up saves")
|
||||
t := time.Now()
|
||||
timeStamp := t.Format(time.RFC3339)
|
||||
savesBackupName := fmt.Sprintf("%s/SaveBackup.%s.tgz", c.Config.BackupDir, timeStamp)
|
||||
saveDir := fmt.Sprintf("%s/saves", c.Config.ServDir)
|
||||
savesBackupName := fmt.Sprintf("%s/SaveBackup.%s.tgz", c.Factoryman.BackupDir, timeStamp)
|
||||
saveDir := fmt.Sprintf("%s/saves", c.Server.ServDir)
|
||||
savesBackup := exec.Command("tar", "-czvf", savesBackupName, saveDir)
|
||||
savesBackup.Stdout = os.Stdout
|
||||
err := savesBackup.Run()
|
||||
|
||||
Reference in New Issue
Block a user