How do I change the tmp folder of the JFrog CLI?

Adi Vizgan
2019-04-23 11:41


What is the use of the temporary folder for the JFrog CLI and how to change is default '/tmp' location?


The JFrog CLI makes use of GoLang's os.TempDir() function.
On Unix systems, the function returns the value $TMPDIR if non-empty, or else /tmp. On Windows, it uses GetTempPath, returning the first non-empty value from %TMP%%TEMP%%USERPROFILE%, or the Windows directory. On Plan 9, it returns /tmp.
In order to change the location of the temporary folder for the JFrog CLI, you may set these variables (on your respective OS) for a directory that works best for you.
Please note: Changing this parameter, will change the temporary directory of the whole system.

If you like to avoid this system, please refer to the solution below:
There is another option to declare the variable along with your command. For example:
$ TMPDIR="/tmp" jfrog rt dl test-generic/test_file.tar.gz –url=http://<artifactory-url>:8081/artifactory/

This will only set the variable for this specific command and keep the rest of your system the same.