I have a syslog server at home and am currently experiencing an issue where my logs will rotate and compress however it will rotate and compress yesterdays file and the newly created log file for the current day. When it does this however it will also create another new file for today and as a result my compressed files look like this:
Here is a copy of my syslog-ng.conf:
Here is the section in my syslog-ng.conf file that is relevant to the logs above
Here is my cron job that is running:
My question is this, what do I do in order to make sure that only yesterdays file gets compressed at 2 minutes beyond midnight instead of both current and yesterday files. If there is any other information required don't hesistate to ask.
Last edited by MyUserName7000; 08-15-2019 at 01:32 PM..
I have never used this command before. I need to use the "compress" command to compress all files located in the subdirectories under the following directories:
/home/ftp/inbound/Fordin
Please advise, I appreciate your help.
Thanks,
Syed (3 Replies)
I am new to UNIX and I am trying to write a shell script. I want to be able to list all files that were created with yesterdays dates (APR 29 as an example) that are not 0 file size.Then in those files I want to look for the string 'Process Complete' and list all files that DONT have that string.... (8 Replies)
Hi, i have written a script in unix which produces two files(.csv file) at the end. Now i want to add these to files in a zip file and send the zip file across the network by FTP.
Problem is that i dunno how to make a single zip file containing the two files that have been created by the script.... (1 Reply)
i tried to use "find" to get all of yesterdays files but missed something in the 24 hours logic.
can anybody help me with this one?
i thought that -daystart -atime 1 was enough but i got more files (2 Replies)
Hello All
My first post in the forum. :)
I've this huge log files of size 20GB-30 GB in my unix server. I want to analyse the log file for some error messages. But because of the enormity of the size of these files i'm not able to grep/search the pattern in the file . Also, tried to gzip the... (1 Reply)
hi All,
I have this sample text file - access.log:
Jan 18 21:34:29 root 209.151.232.70
Jan 18 21:34:40 root 209.151.232.70
Jan 18 21:34:43 root 209.151.232.70
Jan 18 21:34:56 root 209.151.232.70
Jan 18 21:35:10 root 209.151.232.70
Jan 18 21:35:23 root 209.151.232.70
Jan 18 21:36:04 root... (2 Replies)
hi everyone ,
Can someone provide me a shell program to compress and decompress files using gzip , i dont know anything in shell programming , this code is a part of my project.
So can someone help with me the code ? (2 Replies)
I am trying to display todays and yesterdays .rej files from a directory.
ls -lrt *.rej | grep 'Aug 12' ; ls -lrt *.rej | grep 'Aug 13'
Which is working as above.
But i want take 'Aug 12' and 'Aug 13' from a variable and the command should work everyday.
I am able to get todays files by... (9 Replies)
I need help to do a script that will compress a file that's bigger than 5000 octets and won't overwrite the previous compress file.
lets say I have mylogfile.log and I would compress it I would become
mylogfile. 1. log and if I would compress again mylogfile.log it would be
mylogfile. 2.... (8 Replies)
I have written script which is working in Home directory perfectly and also compressing log files and rotating correctly. But, when i try to run script for /var/log/ i am able to get compressed log files but not able to get rotation of compressed log files. Please suggest.
I am using below command... (5 Replies)
Discussion started by: VSom007
5 Replies
LEARN ABOUT PHP
savelog
SAVELOG(8) System Manager's Manual SAVELOG(8)NAME
savelog - save a log file
SYNOPSIS
savelog [-m mode] [-u user] [-g group] [-t] [-p] [-c cycle] [-l] [-j] [-J] [-1 .. -9] [-C] [-d] [-l] [-r rolldir] [-n] [-q] [-D dateformat]
file ...
DESCRIPTION
The savelog command saves and optionally compresses old copies of files. Older versions of file are named:
file.<number><compress_suffix>
where <number> is the version number, 0 being the newest. Version numbers > 0 are compressed unless -l prevents it. Version number 0 is
not compressed because a process might still have file opened for I/O. Only cycle versions of the file are kept.
If the file does not exist and -t was given, it will be created.
For files that do exist and have lengths greater than zero, the following actions are performed:
1) Version numbered files are cycled. Version file.2 is moved to version file.3, version file.1 is moved to version file.2, and so on.
Finally version file.0 is moved to version file.1, and version file is deleted. Both compressed names and uncompressed names are
cycled, regardless of -l. Missing version files are ignored.
2) The new file.1 is compressed unless the -l flag was given. It is changed subject to the -m, -u, and -g flags.
3) The main file is moved to file.0.
4) If the -m, -u, -g, -t, or -p flags are given, then an empty file is created subject to the given flags. With the -p flag, the file
is created with the same owner, group, and permissions as before.
5) The new file.0 is changed subject to the -m, -u, and -g flags.
OPTIONS -m mode
chmod the log files to mode, implies -t
-u user
chown log files to user, implies -t
-g group
chgrp log files to group, implies -t
-c cycle
Save cycle versions of the logfile (default: 7). The cycle count must be at least 2.
-t touch new logfile into existence
-l don't compress any log files (default: do compress)
-p preserve owner, group, and permissions of logfile
-j compress with bzip2 instead of gzip
-J compress with xz instead of gzip
For xz no strength option is set, and xz decides on the default based on the total amount of physical RAM. Note that xz can use a
very large amount of memory for the higher compression levels.
-1 .. -9
compression strength or memory usage (default: 9, except for xz)
-C force cleanup of cycled logfiles
-d use standard date for rolling
-D dateformat
override date format, in the syntax understood by the date(1) command
-r use rolldir instead of . to roll files
-n do not rotate empty files
-q be quiet
BUGS
If a process is still writing to file.0, and savelog moves it to file.1 and compresses it, data could be lost.
SEE ALSO logrotate(8)Debian 30 Dec 2017 SAVELOG(8)