// Validate a given config file. func validate(configPath string) { _, err := config.LoadConfig(configPath) if err != nil { log.Fatalf("Frosty config file: %v - FAILED\n", configPath) os.Exit(1) } fmt.Printf("Frosty config file: %v - OK\n", configPath) }
// The main function for beginning backups. This is the default way in which frosty will run. It loads a config file // and then execute all the backups. func backup(configPath string) { fc, err := config.LoadConfig(configPath) if err != nil { log.Fatal(err) os.Exit(1) } bs := backupservice.NewBackupService(&fc.BackupConfig) sj := fc.ScheduledJobs() scheduleJobs(sj, bs, fc) select {} }