Displaying 2 results from an estimated 2 matches for "maxfilesize".
2017 Dec 02
2
Log rotation issue
On Sat, 2017-12-02 at 11:58 +0530, Anantha Raghava wrote:
> Hello Andrew,
>
> Thanks for proper explanation.
>
> To overcome this, also as we need to store logs for long, now we
> have written a shell script, executed as a crop every three minutes
> that checks the file size. If the file size is 1 GB or above, it
> moves the log file to
2017 Dec 03
0
Log rotation issue
...cal/samba/var/locks/sysvol/exza.com/scripts
read only = No
[sysvol]
path = /usr/local/samba/var/locks/sysvol
read only = No/*
*/
/*Script used to rotate log*/
File size is set to 10 MB in this script. This script runs in background
(not as a cron).
**/**/
#!/bin/bash
MaxFileSize=10000000
while true
do
file_size=`du -b /var/log/samba/dc1.current.log | tr -s '\t' ' ' |
cut -d' ' -f1`
if [ $file_size -gt $MaxFileSize ];then
timestamp=`date +%Y%m%d%H%M%S`
cp -pr "/var/log/samba/dc1.current.log"
"/var/log/samb...