Yes, the simplest way is to configure logrotate
to manage your storagenode logs. It should already be running on your system. I recommend placing a logrotate config specifically for your node(s) in the /etc/logrotate.d
folder. For example, I have a file /etc/logrotate.d/storagenode
(it can have any name). The file contents are:
/path/to/logs/storj*/storagenode*.log {
su username username
weekly
maxsize 200M
rotate 52
dateext
dateformat -%Y%m%d
compress
delaycompress
missingok
notifempty
copytruncate
}
There are many options, so pick what is right for you. In my case this rotates two sets of logs (hence the wildcards), the logs are owned by my non-root user/group so I had to specify, and then I specify the rotate options. The config file has to be owned by root:root, so you’ll have to chown
the config file. You can do dry-runs by running sudo logrotate -d /etc/logrotate.d/storagenode
More information on logrotate here: