Beispiel #1
0
// 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)
}
Beispiel #2
0
// 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 {}
}