Skip to content

Commit

Permalink
upgrade backup code, small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
suurkivi committed Oct 16, 2024
1 parent f34f219 commit 2ebcca4
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion backup/backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func PrepareForBackup(opts *cfg2.BackupConfig) (string, error) {
return "", errors.New("backup_host unset in config file")
}

if len(opts.Targets) == 0 {
if len(opts.Targets)+len(opts.KeychainProfiles) == 0 {
return "", errors.New("no backup configs found!")
}

Expand Down
2 changes: 1 addition & 1 deletion cmd/z2-backup/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func run() error {
return errors.Wrap(err, "check config")
}

err = restic.Run(&opts.Backup, backupPath, restic.LogMessages(func(msg string) error {
err = restic.Run(&opts.Backup, backupPath, []string{"."}, restic.LogMessages(func(msg string) error {
fmt.Println(msg)
return nil
}))
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ require (
github.com/kr/text v0.2.0 // indirect
github.com/leodido/go-urn v1.4.0 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/minor-industries/backup v0.0.0-20241016165138-a90733379ccb // indirect
github.com/minor-industries/backup v0.0.1 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/pelletier/go-toml/v2 v2.2.3 // indirect
Expand Down
6 changes: 6 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@ github.com/minor-industries/backup v0.0.0-20241016163152-757b19a4d47b h1:/4CGoUL
github.com/minor-industries/backup v0.0.0-20241016163152-757b19a4d47b/go.mod h1:RggHPqXbHhTxy+rcEwfP3zv1CewnvY7nVFsI3Fqv7KA=
github.com/minor-industries/backup v0.0.0-20241016165138-a90733379ccb h1:NeXn5YRJCg9mh7nAKK/OvmbbCWl8mQmdPQ4cqcs2qFk=
github.com/minor-industries/backup v0.0.0-20241016165138-a90733379ccb/go.mod h1:RggHPqXbHhTxy+rcEwfP3zv1CewnvY7nVFsI3Fqv7KA=
github.com/minor-industries/backup v0.0.0-20241016193124-326e0a94f419 h1:0WeD1JDbPpFxjlAZ57reICShJdi/2Co7zvBYvKBFVoA=
github.com/minor-industries/backup v0.0.0-20241016193124-326e0a94f419/go.mod h1:RggHPqXbHhTxy+rcEwfP3zv1CewnvY7nVFsI3Fqv7KA=
github.com/minor-industries/backup v0.0.0-20241016194005-0cdf84fc9493 h1:SW2rrMxHQXyVLEFElsOEZYHko1772sJHsD2Y9yGC3rw=
github.com/minor-industries/backup v0.0.0-20241016194005-0cdf84fc9493/go.mod h1:RggHPqXbHhTxy+rcEwfP3zv1CewnvY7nVFsI3Fqv7KA=
github.com/minor-industries/backup v0.0.1 h1:5cNBRjd4arTuq7t6y+YiON7Rhat+IscCWuKAItZe954=
github.com/minor-industries/backup v0.0.1/go.mod h1:RggHPqXbHhTxy+rcEwfP3zv1CewnvY7nVFsI3Fqv7KA=
github.com/minor-industries/calendar v0.0.2 h1:z0HSSbS/dC4NktGuWPNYtV7/EMhjaN9nLB0nVxMGIyY=
github.com/minor-industries/calendar v0.0.2/go.mod h1:ObostlqefZmRtphanxopvWSVW2dhQ2KiJCqC5jZvQZc=
github.com/minor-industries/rtgraph v0.0.20 h1:/H0xAETtSck3pl7tzNHzeGgykGfVPvl8rxWrsPm+Er0=
Expand Down
2 changes: 1 addition & 1 deletion routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ func setupRoutes(
return
}

if err := restic.Run(&opts.Backup, backupPath, restic.LogMessages(func(msg string) error {
if err := restic.Run(&opts.Backup, backupPath, []string{"."}, restic.LogMessages(func(msg string) error {
_ = send("info", msg)
return nil
})); err != nil {
Expand Down

0 comments on commit 2ebcca4

Please sign in to comment.