Skip to content

add flag/envvar to choose temp directory#867

Open
nyetsche wants to merge 1 commit into
peak:masterfrom
nyetsche:tmpdir-override
Open

add flag/envvar to choose temp directory#867
nyetsche wants to merge 1 commit into
peak:masterfrom
nyetsche:tmpdir-override

Conversation

@nyetsche
Copy link
Copy Markdown

@nyetsche nyetsche commented May 6, 2026

the sync command uses "github.com/lanrat/extsort" to create a temporary directory (and files) for computing what to copy

this PR adds a command line flag (& equivalent environment variable) to control where the directory is created. without it set, you always get the "intelligent choice", such as /tmp, but users have plenty of reasons to choose a different directory (/tmp too small, faster location that extsort didn't notice, etc.)

Ref: https://github.com/lanrat/extsort#temporary-directory-selection

example usage:

s5cmd sync --sort-temp-dir=/scratch FILE s3://[somewhere]/FILE

or

export S5CMD_SORT_TEMP_DIR=/scratch
s5cmd sync FILE s3://[somewhere]/FILE

the `sync` command uses `"github.com/lanrat/extsort"` to create a
temporary directory (and files) for computing what to copy

this PR adds a command line flag (& equivalent environment variable) to
control where the directory is created. without it set, you always get
the "intelligent choice", such as `/tmp`, but users have plenty of
reasons to choose a different directory (`/tmp` too small, faster
location that `extsort` didn't notice, etc.)

Ref: https://github.com/lanrat/extsort#temporary-directory-selection

example usage:

```
s5cmd sync --sort-temp-dir=/scratch FILE s3://[somewhere]/FILE
```

or

```
export S5CMD_SORT_TEMP_DIR=/scratch
s5cmd sync FILE s3://[somewhere]/FILE
```
@nyetsche nyetsche requested a review from a team as a code owner May 6, 2026 17:40
@nyetsche nyetsche requested review from ilkinulas and sonmezonur and removed request for a team May 6, 2026 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant