test email and clean first snapshots
This commit is contained in:
18
app.go
18
app.go
@@ -668,7 +668,7 @@ func (a AppConfig) CleanupSnapshot() error {
|
||||
|
||||
for k, v := range cleanupSnapshot {
|
||||
if *debugFlag {
|
||||
log.Printf("AppConfig.CleanupSnapshot : %s : cleaning snapshots on %s for%s", a.Name, k, v)
|
||||
log.Printf("AppConfig.CleanupSnapshot : %s : cleaning snapshots on %s for %s", a.Name, k, v)
|
||||
}
|
||||
_, err := cfg.Box[k].SSHExec("zfsnap destroy -p hourly- -p daily- -p weekly- -p monthly- -p yearly-" + v)
|
||||
if err != nil {
|
||||
@@ -704,6 +704,14 @@ func (a AppConfig) RunAppBackup() error {
|
||||
}
|
||||
}
|
||||
|
||||
err = a.CleanupSnapshot()
|
||||
if err != nil {
|
||||
if *debugFlag {
|
||||
log.Printf("AppConfig.RunAppBackup : %s : CleanupSnapshot : %s", a.Name, err)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
if schedule != "" {
|
||||
err = a.ExecBefore(schedule)
|
||||
if err != nil {
|
||||
@@ -748,13 +756,5 @@ func (a AppConfig) RunAppBackup() error {
|
||||
}
|
||||
}
|
||||
|
||||
err = a.CleanupSnapshot()
|
||||
if err != nil {
|
||||
if *debugFlag {
|
||||
log.Printf("AppConfig.RunAppBackup : %s : RefreshSnapshot : %s", a.Name, err)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user