Powerful tools such as logrotate make it much easier to rotate log or backup files. The files are rotated after a certain period of time or when they reach a certain size. If you do not have this tool available on a remote server and can only execute SSH commands remotely, you can help yourself with a small bash script that deletes old files and only sends one request.
3c60340a9838f9759ee93711c14d34cf