1
0
mirror of https://github.com/Luzifer/duplicity-backup.git synced 2024-09-19 00:12:55 +00:00

Do backup removes only after certain commands

This commit is contained in:
Knut Ahlers 2016-05-23 11:59:23 +02:00
parent 6c841d29f4
commit 32259a0a6a
Signed by: luzifer
GPG Key ID: DC2729FDD34BE99E
2 changed files with 6 additions and 1 deletions

View File

@ -27,6 +27,10 @@ var (
commandBackup,
commandRemove,
}
removeCommands = []string{
commandBackup,
commandCleanup,
}
)
type configFile struct {

View File

@ -10,6 +10,7 @@ import (
"strings"
"time"
"github.com/Luzifer/go_helpers/str"
"github.com/Luzifer/go_helpers/which"
"github.com/Luzifer/rconfig"
"github.com/mitchellh/go-homedir"
@ -117,7 +118,7 @@ func main() {
return
}
if config.Cleanup.Type != "none" {
if config.Cleanup.Type != "none" && str.StringInSlice(argv[1], removeCommands) {
logf("++++ Starting removal of old backups")
if err := execute(config, []string{commandRemove}); err != nil {