Skip to content

Commit

Permalink
Merge pull request #14 from lookup82/master
Browse files Browse the repository at this point in the history
Add flag namespace
  • Loading branch information
tizbac authored Feb 5, 2024
2 parents 8f905cd + ea400df commit 457bbe1
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,14 @@ proxmoxbackupgo.exe
Certificate fingerprint for SSL connection, example: ea:7d:06:f9...
-datastore string
Datastore name
-pxarout string (optional)
Output PXAR archive for debug purposes
-namespace string
Namespace (optional)
-pxarout string
Output PXAR archive for debug purposes (optional)
-secret string
Secret for authentication
```

Known Issues
Expand Down
2 changes: 2 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ func main() {
authIDFlag := flag.String("authid", "", "Authentication ID (PBS Api token)")
secretFlag := flag.String("secret", "", "Secret for authentication")
datastoreFlag := flag.String("datastore", "", "Datastore name")
namespaceFlag := flag.String("namespace", "", "Namespace (optional)")
backupSourceDirFlag := flag.String("backupdir", "", "Backup source directory, must not be symlink")
pxarOut := flag.String("pxarout", "", "Output PXAR archive for debug purposes (optional)")

Expand Down Expand Up @@ -99,6 +100,7 @@ func main() {
authid: *authIDFlag,
secret: *secretFlag,
datastore: *datastoreFlag,
namespace: *namespaceFlag,
}

backupdir := *backupSourceDirFlag
Expand Down
4 changes: 4 additions & 0 deletions pbsapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ type PBSClient struct {
authid string

datastore string
namespace string
manifest BackupManifest

client http.Client
Expand Down Expand Up @@ -366,6 +367,9 @@ func (pbs *PBSClient) Connect(reader bool) {
q.Add("backup-time", fmt.Sprintf("%d", pbs.manifest.BackupTime))
q.Add("backup-type", pbs.manifest.BackupType)
q.Add("store", pbs.datastore)
if pbs.namespace != "" {
q.Add("ns", pbs.namespace)
}

q.Add("backup-id", pbs.manifest.BackupID)
q.Add("debug", "1")
Expand Down

0 comments on commit 457bbe1

Please sign in to comment.