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:
parent
6c841d29f4
commit
32259a0a6a
@ -27,6 +27,10 @@ var (
|
||||
commandBackup,
|
||||
commandRemove,
|
||||
}
|
||||
removeCommands = []string{
|
||||
commandBackup,
|
||||
commandCleanup,
|
||||
}
|
||||
)
|
||||
|
||||
type configFile struct {
|
||||
|
3
main.go
3
main.go
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user