Rclone copy and deleting afterwards

Hey guys

as --delete-X does not work with rclone copy I’m wondering about a small script I can run by cron.
Will this work?

rclone copy local/path/to/files remote:/path/to/files
find /local/path/to/files -mmin 180 -type f -delete

this would run scheduled every 90 minutes, to make sure every new generated file will be uploaded and deleted once the file hits the age of 180 minutes (only have 30GB spare on this VPS).

Thanks for your feedback and possible improvements.


Looks like you might be looking for rclone move?

ha! you’re right!
so rclone move -v --min-age 180 local/path/to/files remote:/path/to/files will move only files not touched for 3 minutes, right?
Will prevent errors due to “in Progress” files.
Are the folders contained in local/path/to/files deleted if they’re empty?

That looks about right.

Not yet - there is an issue for that though