Hi Dan,
With the release of synctool 4.2.0 we made some improvements to the way we are handling large file uploads. Namely, we have added support for automatic retries at the chunk level rather than at the entire file level. Additionally, it the chunk already exists in DuraCloud, we are now performing a checksum on each chunk before transferring it. If the chunk already exists with the expected checksum, we do not spend the time and bandwidth transferring it. In order to accomplish these changes, we now write the chunk to be transferred to disk before transferring it. Upon completion (be it successful or otherwise) we delete the temp file. There is one important implication to this change. If you are transferring files over 1GB, you must have at least 1GB of extra disk space per worker thread (ie specified in the -t setting) in addition to space for storing your sync tool logs. Thus it is those very temp chunks that you are seeing in the temp dir. Therefore if you want to run 10 simultaneous threads you'll need at least 10 GBs of space plus addition space for logs. As long as the jvm shuts down in an orderly way, those files will be removed.
So to answer your first question, you can set the temp directory by adding -Djava.io.tmpdir=/path/to/your/tmpdir to the command line parameters.
I'm not sure I can give you a good answer for 2. You can certainly remove them from your tmpdir if the app is not running. If you see files in the tempdir when the application is not running, it is likely that the JVM did not shutdown in an orderly way and thus did not have a chance to clean up which it should do under normal circumstances. If the tool is still running, it is possible that you are simply seeing the chunks that are currently being transferred.
Best regards,
Daniel Bernstein
DuraCloud Support