-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Adis Durakovic
committed
Mar 8, 2024
1 parent
339c121
commit 676f7ed
Showing
13 changed files
with
216 additions
and
198 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package main | ||
|
||
import ( | ||
"bytes" | ||
"flag" | ||
|
||
"github.com/ad-on-is/resticity/internal" | ||
|
||
"github.com/charmbracelet/log" | ||
) | ||
|
||
func main() { | ||
log.SetLevel(log.DebugLevel) | ||
flagConfigFile := "" | ||
flag.StringVar(&flagConfigFile, "config", "", "Specify a config file") | ||
flag.StringVar(&flagConfigFile, "c", "", "Specify a config file") | ||
flag.Parse() | ||
log.Info("settings file", flagConfigFile) | ||
errb := bytes.NewBuffer([]byte{}) | ||
outb := bytes.NewBuffer([]byte{}) | ||
outputChan := make(chan internal.ChanMsg) | ||
settings := internal.NewSettings(flagConfigFile) | ||
restic := internal.NewRestic(errb, outb, settings) | ||
if scheduler, err := internal.NewScheduler(settings, restic, &outputChan); err == nil { | ||
(scheduler).RescheduleBackups() | ||
internal.RunServer(scheduler, restic, settings, errb, outb, &outputChan) | ||
|
||
} else { | ||
log.Error("Init scheduler", "error", err) | ||
} | ||
|
||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
export namespace main { | ||
export namespace internal { | ||
|
||
export interface Backup { | ||
id: string; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
module resticity | ||
module github.com/ad-on-is/resticity | ||
|
||
go 1.21 | ||
|
||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package main | ||
package internal | ||
|
||
import ( | ||
"bufio" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package main | ||
package internal | ||
|
||
import ( | ||
"encoding/json" | ||
|
Oops, something went wrong.