示例#1
0
func verifyName(name string, confFile *stash.Config) {
	if confFile.IsDuplicateEntry(stash.ConfigEntry{Name: name}) {
		color.Red("Attempted to add duplicate entry [%s], "+
			"if you were trying to add folders to an existing backup "+
			"destination, use 'stash folder add'", name)
		os.Exit(1)
	}
}
示例#2
0
文件: main.go 项目: sparrc/stash
func processBackups(config *stash.Config) {
	for _, entry := range config.Entries {
		// log.Println("Processing Backup:	", entry.Name)
		if entry.LastBak.Add(entry.Frequency).Before(time.Now()) {
			doBackup(entry)
			config.TouchLastBak(entry.Name)
			config.ReloadConfig()
		}
	}
}