Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Copy last 30 minutes' contents from a log file Post 303040260 by Chubler_XL on Friday 25th of October 2019 04:22:59 PM
Old 10-25-2019
Assumption is that if a logrotation occurs the resulting file will be smaller that the last run.
This is identified with [ $EndLine -lt $StartLine ] && StartLine=0

On systems I have worked with log files grow at a fairly consistent rate and logrotation only occurs every week.

Not to say it's impossible but and I've never encountered a file that got truncated and then grew bigger than it's previous size within 30mins.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Copy selected contents from file

I want to capture contents of a file between 2 strings into another file for eg all lines in between the keywords "start log" and "end log" should be copied into another file (4 Replies)
Discussion started by: misenkiser
4 Replies

2. Shell Programming and Scripting

Automatic Copy of File Contents to Clipboard

Could someone show me how to copy the contents of a file to the clipboard automatically without manually selecting its contents? I just want to press the "Paste Key" to show the results. I wish to use this in a ksh script. I'm using Solaris. Thanks! (5 Replies)
Discussion started by: ilak1008
5 Replies

3. Shell Programming and Scripting

Bash copy file contents into an existing file at a specific location

Hi all I need to copy the entire contents of one file into an existing file at a specific location. I know the exact line number where I need to put it. It appears I would use either sed or awk to do this, but I have been unsuccessful so far: File A line 1 line 2 line 3 line 4 ... (6 Replies)
Discussion started by: gshepherd7
6 Replies

4. Shell Programming and Scripting

Copy contents of a directory only if a file exists

I'm looking to write a script that will check the contents of a directory, and if any files exist in that directory copy them to a temporary folder. The target files are only resident for a few seconds, so I think the script needs to be running constantly. Any pointers would be really... (3 Replies)
Discussion started by: danceofillusion
3 Replies

5. Shell Programming and Scripting

copy the contents between two keywords to a new file.

Hi All, I want to edit my gate level netlists by searching for the content between two patterns eg: ff1 \test/a0 ( .CLK(\test/ClkInt0_acb_00x1 ),.D(\test/Rakicc ), .QB(\test/X ), .VDD(1'b1), .VSS(1'b0)); ff1 \test/a1 ( .CLK(\test/medis0_acb_00x1 ),.D(\test/hedwc ), .QB(\test/X ),... (6 Replies)
Discussion started by: naveen@
6 Replies

6. UNIX for Dummies Questions & Answers

Copy entire contents of file to clipboard

Hi, I am trying to figure out how to copy the contents of a file to the clipboard, then paste into a command. i.e copy contents of file /path/filename.txt to <command> <paste text> Hope that makes sense. Basically tryting to copy the text for use in a command without having to open the... (8 Replies)
Discussion started by: JCA70
8 Replies

7. Shell Programming and Scripting

Need help to copy contents of a file

Hi, I am stuck up with a problem of copying the contents of a directory where one of the folder name is changed daily. Problem: I have the folder structure as: RefWorlds2/LINGCC4_X64/odsdev/odessy/UTI/621GA_build_xxx/.../.. In the above path the build number (xxx) will be changed... (3 Replies)
Discussion started by: SathaKarni
3 Replies

8. Shell Programming and Scripting

Need Script to copy the contents of two files into one file

Hi i need Script to copy the contents of two files into one file i have 2 fil X1.txt / X2.txt i need script to copy the contents of X1 and X2 In AllXfile X1.txt File X1 X2.txt File X2 AllXfile.txt File X1 File X2 (2 Replies)
Discussion started by: azzeddine2005
2 Replies

9. Shell Programming and Scripting

Copy contents of one file to another

I need to write a script (in bash) that copies the content of the first file in each folder of a directory to the second file in the same folder. I tried this and it didn't work - it just came back with errors and I'm not sure how to fix it. Help is very much appreciated! for mpdir in... (4 Replies)
Discussion started by: LeftoverStew
4 Replies

10. Shell Programming and Scripting

Grep a log file for the last 5 minutes of contents every 5 minutes

Hi all, System Ubuntu 16.04.3 LTS i have the following log INFO 2019-02-07 15:13:31,099 module.py:700] default: "POST /join/8550614e-3e94-4fa5-9ab2-135eefa69c1b HTTP/1.0" 500 2042 INFO 2019-02-07 15:13:31,569 module.py:700] default: "POST /join/6cb9c452-dcb1-45f3-bcca-e33f5d450105... (15 Replies)
Discussion started by: charli1
15 Replies
CHECKSECURITY(8)					      System Manager's Manual						  CHECKSECURITY(8)

NAME
checksecurity - check for changes to setuid programs SYNOPSIS
checksecurity DESCRIPTION
The checksecurity command scans the mounted files systems (subject to the filter defined in /etc/checksecurity.conf) and compares the list of setuid programs to the list created on the previous run. Any changes are printed to standard output. Also, it generates a list of nfs and afs filesystems that are mounted insecurely (i.e. they are missing the nodev and either the noexec or nosuid flags). checksecurity is run by cron on a daily basis, and the output stored in /var/log/setuid/setuid.changes. CONFIGURATION
The checksecurity.conf file defines several configuration variables: CHECKSECURITY_FILTER, CHECKSECURITY_NOFINDERRORS, CHECKSECURITY_NONF- SAFS, CHECKSECURITY_EMAIL, CHECKSECURITY_DEVICEFILTER, CHECKSECURITY_PATHFILTER, and LOGDIR. Each is described below. The CHECKSECURITY_FILTER environment variable which is the argument of 'grep -vE' applied to the output of the mount command. In other words, the value of CHECKSECURITY_FILTER is a regular expression that removes matching lines from those file systems that will be scanned. The default value removes all file systems of type proc, bind, msdos, iso9660, ncpfs, nfs, afs, smbfs, auto, ntfs, coda file systems, any- thing mounted on /dev/fd*, anything mounted on /mnt or /amd, and anything mounted with option nosuid or noexec. The checksecurity.conf file is sourced from checksecurity, so you could do some fairly tricky things to define CHECKSECURITY_FILTER. The CHECKSECURITY_NOFINDERRORS environment variable, if set to the literal "TRUE", disables find errors from checksecurity (actually, it re-routes them to /dev/null ). The CHECKSECURITY_NONFSAFS environment variable, if set to the literal "TRUE", disables the message about nfs and afs file systems that are mounted without the nodev and either the noexec or nosuid options. If set, the CHECKSECURITY_EMAIL variable defines who is sent a copy of the setuid.changes file. The CHECKSECURITY_DEVICEFILTER variable specifies a find clause for which matching block and character device files will not be monitored for changing owners and permissions. For example, if you don't want to check for permission changes on tty device files beneath /dev, you could set the following: CHECKSECURITY_DEVICEFILTER='-path /dev/tty*' Note that any added or modified suid programs under that path would still be detected. If you want to specify multiple expressions, sepa- rate them with '-o', but there is no need to surround the whole clause with parentheses. To disable this filter, specify it as '-false' (which is the default). Note that if the system gets restarted often checksecurity will report a lot of changes in the /dev/ subdirectory due to timestamp changes. In this case you might want to change it to: CHECKSECURITY_DEVICEFILTER='-path /dev/' The CHECKSECURITY_PATHFILTER variable specifies a find clause which will be pruned from the search path. This means that the entire sub- tree will be completely skipped. Thus, specifying CHECKSECURITY_PATHFILTER='-path /var/ftp' then the entire /var/ftp tree will be skipped. To disable this filter, specify it as '-false' (which is the default). LOGDIR sets the name of the directory which stores the files which track the permission and ownership changes. By default, they are in /var/log/setuid. FILES
/etc/checksecurity.conf checksecurity configuration file /var/log/setuid/setuid.today setuid files from the most recent run /var/log/setuid/setuid.yesterday setuid files from the previous run Debian Linux 2 February 1997 CHECKSECURITY(8)
All times are GMT -4. The time now is 08:51 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy