diff --git a/pkg/service/storage/azure.go b/pkg/service/storage/azure.go index 55807c5b..ce300a40 100644 --- a/pkg/service/storage/azure.go +++ b/pkg/service/storage/azure.go @@ -30,7 +30,7 @@ func (a *AzureStorageAccessor) createReader( opts := []azure.Opt{ azure.WithValidator(filter), azure.WithNestedDir(), - azure.WithStartAfter(startScanFrom), + azure.WithStartAfter(filepath.Join(azures.Path, startScanFrom)), } fullPath := filepath.Join(azures.Path, path) if isFile { diff --git a/pkg/service/storage/gcp.go b/pkg/service/storage/gcp.go index b991e09b..e138252a 100644 --- a/pkg/service/storage/gcp.go +++ b/pkg/service/storage/gcp.go @@ -30,7 +30,7 @@ func (a *GcpStorageAccessor) createReader( opts := []gcp.Opt{ gcp.WithValidator(filter), gcp.WithNestedDir(), - gcp.WithStartOffset(startScanFrom), + gcp.WithStartOffset(filepath.Join(gcps.Path, startScanFrom)), } fullPath := filepath.Join(gcps.Path, path) if isFile { diff --git a/pkg/service/storage/operations.go b/pkg/service/storage/operations.go index 2d977405..636e04fe 100644 --- a/pkg/service/storage/operations.go +++ b/pkg/service/storage/operations.go @@ -3,8 +3,9 @@ package storage import ( "bytes" "context" - "fmt" "io" + "path/filepath" + "strconv" "time" "github.com/aerospike/aerospike-backup-service/v2/pkg/model" @@ -49,7 +50,8 @@ func ReadFiles(ctx context.Context, storage model.Storage, path string, filterSt ) ([]*bytes.Buffer, error) { var startScanFrom string if fromTime != nil { - startScanFrom = fmt.Sprintf("%s/%d", path, fromTime.UnixMilli()-1) // -1 to ensure filter is greater or equal. + fromTimeStr := strconv.FormatInt(fromTime.UnixMilli()-1, 10) // -1 to ensure filter is greater or equal. + startScanFrom = filepath.Join(path, fromTimeStr) } reader, err := CreateReader(ctx, storage, path, false, newNameValidator(filterStr), startScanFrom) diff --git a/pkg/service/storage/s3.go b/pkg/service/storage/s3.go index 34e18de2..a043fa4c 100644 --- a/pkg/service/storage/s3.go +++ b/pkg/service/storage/s3.go @@ -30,7 +30,7 @@ func (a *S3StorageAccessor) createReader( opts := []s3.Opt{ s3.WithValidator(filter), s3.WithNestedDir(), - s3.WithStartAfter(startScanFrom), + s3.WithStartAfter(filepath.Join(s3s.Path, startScanFrom)), } fullPath := filepath.Join(s3s.Path, path) if isFile {