Change checksum/crypt location

I have recently started using rclone together with Backblaze B2 and also Jottacloud.
Both remotes seem to suffer from a problem when using a crypt remote on top of them.
My storage server has 32GB of ECC RAM and the problem seems to occur when I try to upload a file where the size goes above the amount of system memory.
I am quite sure that the problem is the encryption process that runs under /tmp and at some point the server runs out of memory and the processing is aborted and retried.
The most extreme example is a 120GB image of my laptop. If I run it directly to the remote, without the crypt on top, it runs fine after using a couple of minutes for the checksum calculation.

Is there a way to force rclone to use a specific location for storing temporary files?

Sure, set the TMPDIR environment variable.

However I think you must be using an old version of rclone as rclone hasn’t needed to make temporary files for b2 for some time. Check out the latest release.

I have version 1.45 at the moment. Seems to be the latest version

But I will try with TMPDIR to see how it goes

Jottacloud will be using the temporary directory even in 1.45 so you will need to set TMPDIR there.

I have now tried to set the TMPDIR by running the commands below:
TMPDIR=/mydatastore/tmp/ && rclone sync /mydatastore/nasdata/ cryptedoffsite:/nasdata/

However, it still tries to store the data in /tmp, which is basically system RAM.
If I then check what TMPDIR is after running the above, then it shows the correct path when executing:
echo $TMPDIR

What could go wrong?

You need to export TMPDIR to make it available to subprocesses


export TMPDIR=/mydatastore/tmp/
rclone ...