While using "batchsim" command in MATLAB Parallel Server, how can I transfer the simulation results directly to Amazon S3 bucket? I am using MATLAB Parallel Server with AWS using the "batchsim" commands. At the end of the simulation, I want to post-process the data and save the data in the Amazon S3 bucket directly, without fetching the data in the local machine to save memory using the command line Can you please let me know if this possible and how to trigger these commands using "batchsim"? I don't want to use "fetchOutputs" command, but do some post-processing and directly write the outputs to S3 bucket in AWS.
Kshitij Singh answered .
2025-11-20
setenv('AWS_ACCESS_KEY_ID', '1234');
setenv('AWS_SECRET_ACCESS_KEY', '1234');
% recursively copy all content from inside a local folder to a folder on a given s3 bucket folderToCopy = 'some/folder/containing/data/to/upload' s3Location = 's3://bucket/copiedFolder'; copyfile(folderToCopy, s3Location);
Or to transfer a single file:
% copy a single local file to copiedFile.dat on a given s3 bucket: fileToCopy = 'some/single/file.dat' s3Location = 's3://bucket/copiedFile.dat'; copyfile(fileToCopy, s3Location);
Obviously, folderToCopy (or fileToCopy) and s3Location will need updating to reflect genuine locations prior to actually attempting a copy.