Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions command/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@ func NewSyncCommandFlags() []cli.Flag {
Name: "exit-on-error",
Usage: "stops the sync process if an error is received",
},
&cli.StringFlag{
Name: "sort-temp-dir",
Usage: "directory for temporary files used when sorting objects to compute the source/destination diff (defaults to the OS temp dir)",
EnvVars: []string{"S5CMD_SORT_TEMP_DIR"},
},
}
sharedFlags := NewSharedFlags()
return append(syncFlags, sharedFlags...)
Expand Down Expand Up @@ -131,6 +136,7 @@ type Sync struct {
delete bool
sizeOnly bool
exitOnError bool
sortTempDir string

// s3 options
storageOpts storage.Options
Expand All @@ -155,6 +161,7 @@ func NewSync(c *cli.Context) Sync {
delete: c.Bool("delete"),
sizeOnly: c.Bool("size-only"),
exitOnError: c.Bool("exit-on-error"),
sortTempDir: c.String("sort-temp-dir"),

// flags
followSymlinks: !c.Bool("no-follow-symlinks"),
Expand Down Expand Up @@ -335,6 +342,7 @@ func (s Sync) getSourceAndDestinationObjects(ctx context.Context, cancel context
NumWorkers: extsortDefaultConfig.NumWorkers,
ChanBuffSize: extsortChannelBufferSize,
SortedChanBuffSize: extsortChannelBufferSize,
TempFilesDir: s.sortTempDir,
}
extsortDefaultConfig = nil

Expand Down
Loading