Jump to content

Finetune a share to write to cache only


DivideBy0
Go to solution Solved by DivideBy0,

Recommended Posts

Here is my intended scenario that partially works now.  I am using this UnRaid as my main syslog repository with syslog server configured to store logs into a dedicated share named LOGS. Fort that I configured a share LOGS with "primary storage" to cache and "secondary storage" to array and 'mover action" cache -->array scheduled weekly. 

 

My expected behavior will be that syslog will constantly write to cache and not array therefore my array & parity drives won't be spinning all the time, except when the mover schedule take place every week.  But that is not the case.  I have about 10 devices sending logs to this UnRaid and some of them are written to cache and some of them to the array, they're are very inconsistent and some of my array and parity drives are constantly spinning.

 

Am I doing something wrong or this is the expected behavior?  Any advise or guidance please

 

 

LOGS.JPG

Edited by DivideBy0
Link to comment
23 hours ago, DivideBy0 said:

 

or this is the expected behavior?

 

Yes.

The mover doesnt move files that are activly being used. if a file has been moved to the array, it will stay on the array if its being modified.

If you wanna solve this you would need to set the "syslog"-share to only live on the cache drive and run a script which copies the logs in the time intervals youre looking for to the array.

Link to comment
  • Solution

I could play with the syslog file size? Now is set to 5Megs. Maybe if I drop it to 1 or 2 Megs will work better? Thinking if I limit the size then syslog will start writing new files on cache and when the movers kick in it will just move the completed ones.

 

Well I ended up with a custom script that does it all for me daily.

 

#!/bin/bash
sh /etc/rc.d/rc.rsyslogd stop
for file in /mnt/cache/NVME-LOGS/*; do
    mv "$file" "/mnt/disk7/LOGS/$(date +"%Y%m%d_%H%M%S")_$(basename "$file")"
done
sh /etc/rc.d/rc.rsyslogd start

Edited by DivideBy0
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.

×
×
  • Create New...