Where to store logs?


Recommended Posts

Hello,

 

I have 2 scripts that automatically move files from local storage to GDrive. I currently have the logs going to a user share under /mnt/user/rclone/logs

 

I also have setup logrotate in /etc/logrotate.d to rotate the logs daily and keep 7 of them.

 

I wanted to know if it's okay to store logs in /var/log instead?

Link to comment
2 minutes ago, BRiT said:

/var/log/ is is RAM.

It will all be removed on reboots.

Since it's in memory, the more you store the more it uses. If you don't have enough memory it will lead to OOM - Out of Memory errors and the kernel will pick randomly what programs to kill.

Thought as much, one of the script has been running since this morning at 8:00 and is at 7.2KB.

 

Will need to watch it over the next 7 days and see how large the files and rotated logs get.

 

All it stores in the log is when the move starts and when it finished with how long it took in seconds. So 2 lines. The script is running every 10mins unless it is already moving. So it has the potential to write 2 lines every 10mins.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.