Any way to limit the rclone log file size?

Hi all

We've been using the rclone log function and it's been immensely helpful. However, we're running into a funny issue where the size of the file for some of our servers is getting large. It's currently not unmanageable but ideally we would like to limit the file size.

Is there any way to do this within the tool itself?

if you run rclone in a script you have several options.

  1. delete the old log before running rclone.
  2. if you want to keep the old log, rename the old log by appending the date and time to it.

you should be able to add it to logrotate.

To clarify, we're trying to set up an automated pipeline with rclone running a continuous rc command as a windows service at the source of data.

Of course, in this case ideally we'd not have to restart the service everytime we want to delete the log file.

Would a simple operations/deletefile work even if the log file is in use?

Thanks

There is an issue about this. https://github.com/rclone/rclone/issues/2259 which show how to configure logrotate.

You meet to truncate the file rather than deleting in otherwise rclone will carry on writing to the deleted file

Essentially would this restart the log file in terms of size? Even if I can't save the old file I'm happy for it to start from blank again.

Yes

If you want to keep the old log then copy it before truncating it.