Skip to content

Commit

Permalink
Merge pull request #147 from 030/138-permission-denied
Browse files Browse the repository at this point in the history
138 permission denied
  • Loading branch information
030 authored Jul 21, 2020
2 parents 75828a3 + 0cf3e88 commit 8b7a9e2
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 4 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
None

## [4.1.4] - 2020-07-21
### Added
- Warning that explains permission denied issue when running N3DR that was installed using snap

## [4.1.3] - 2020-07-20
### Added
- Overwrite default zipFileName
Expand Down Expand Up @@ -220,7 +224,8 @@ None
### Added
- Download all artifacts from a certain Nexus3 repository.

[Unreleased]: https://github.com/030/n3dr/compare/4.1.3...HEAD
[Unreleased]: https://github.com/030/n3dr/compare/4.1.4...HEAD
[4.1.4]: https://github.com/030/n3dr/compare/4.1.3...4.1.4
[4.1.3]: https://github.com/030/n3dr/compare/4.1.2...4.1.3
[4.1.2]: https://github.com/030/n3dr/compare/4.1.1...4.1.2
[4.1.1]: https://github.com/030/n3dr/compare/4.1.0...4.1.1
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ The aims of the n3dr tool are:
snap install n3dr
```

Note: one has to run n3dr from the home folder if this installation mode is
chosen. Otherwise a permission denied issue could occur, while creating the
backup zip.

### MacOSX

Get the darwin artifact from the releases tab.
Expand Down
10 changes: 8 additions & 2 deletions cli/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"fmt"
"io/ioutil"
"net/http"
"os"
"strconv"
"time"

Expand Down Expand Up @@ -98,11 +99,16 @@ func (n Nexus3) CreateZip(dir string) error {
if n.ZipName == "" {
n.ZipName = "n3dr-backup-" + time.Now().Format("01-02-2006T15-04-05") + ".zip"
}
err := archiver.Archive([]string{dir}, n.ZipName)
cwd, err := os.Getwd()
if err != nil {
return err
}
log.Infof("Zipfile: '%v' created", n.ZipName)
log.Warnf("Trying to create a zip file in: '%v'. Note that this could result in a 'permission denied' issue if N3DR has been installed using snap and is run in a different directory than your own home folder.", cwd)
err = archiver.Archive([]string{dir}, n.ZipName)
if err != nil {
return err
}
log.Infof("Zipfile: '%v' created in '%v'", n.ZipName, cwd)
}
return nil
}
2 changes: 1 addition & 1 deletion snap/snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: n3dr # you probably want to 'snapcraft register <name>'
base: core18 # the base snap is the execution environment for this snap
version: '4.1.3' # just for humans, typically '1.2+git' or '1.3.2'
version: '4.1.4' # just for humans, typically '1.2+git' or '1.3.2'
summary: Nexus3 Disaster Recovery # 79 char long summary
description: |
Download all artifacts at once or migrate automatically from Nexus to Nexus.
Expand Down

0 comments on commit 8b7a9e2

Please sign in to comment.