tarBin
continuous-integration/drone/push Build is passing Details
continuous-integration/drone Build is passing Details

This commit is contained in:
Adam Štrauch 2022-07-23 00:36:57 +02:00
parent 8adbf84362
commit b15e85474e
Signed by: cx
GPG Key ID: 018304FFA8988F8D
1 changed files with 3 additions and 2 deletions

View File

@ -20,6 +20,7 @@ const dateFormat = "20060102_150405"
const keySplitCharacter = ":"
const metadataPrefix = "_metadata"
const metadataKeyTemplate = metadataPrefix + "/%s"
const tarBin = "/bin/tar"
// Snapshot contains metadata about a single snapshot
type Snapshot struct {
@ -137,7 +138,7 @@ func (s *SnapshotProcessor) CreateSnapshot(appName string, labels []string) (str
return snapshot.KeyName(s.IndexLabel), fmt.Errorf("change working directory error: %v", err)
}
err = exec.Command("/bin/tar", "-acf", tmpSnapshotArchivePath, "./").Run()
err = exec.Command(tarBin, "-acf", tmpSnapshotArchivePath, "./").Run()
if err != nil {
return snapshot.KeyName(s.IndexLabel), fmt.Errorf("compression error: %v", err)
}
@ -191,7 +192,7 @@ func (s *SnapshotProcessor) RestoreSnapshot(key string, newAppName string) error
return fmt.Errorf("getting the archive from S3 error: %v", err)
}
err = exec.Command("/usr/bin/tar", "-axf", tmpSnapshotArchivePath).Run()
err = exec.Command(tarBin, "-axf", tmpSnapshotArchivePath).Run()
if err != nil {
return fmt.Errorf("unarchiving error: %v", err)
}