I have a small windows application which has rclone placed inside. This app allows users to collect assets (graphic files) in their computer, then hit "upload" button to upload their files to AWS S3.
By the time an user hits the upload button, this app collects everything and stores to a temporary folder, and uploads this folder to S3. And this temporary folder need to be clean up after uploading done.
Could somebody please advise how to know if rclone sync is finished, and base on that "event" this windows app knows when to clean up the temporary folder.
rclone sync should stop and the rclone binary should exit when it is finished. So if you run the binary synchronously you can see when it has stopped and read its exit code which will tell you whether it was successful or not.
This is how I launch rclone (via a windows batch script):
@echo off
cd /d C:\\temp\\rclone
rclone sync C:\temp\collection_3427996 s3:/user_collection_tester01 --delete-after
if not %ERRORLEVEL% equ -1 (
start C:\temp\collection_cleanup_3427996.cmd
)
exit