Delete all log files older than 10 day and whose first string of the first line is "MSH" or "<?xml"
Dear Ladies & Gents,
I have a requirement to delete all the log files in /var/log/test directory that are older than 10 days and their first line begin with "MSH" or "<?xml" or "FHS". I've put together the following BASH script, but it's erroring out:
Hi Friends,
Can any of you explain me about the below line of code?
mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`
Im not able to understand, what exactly it is doing :confused:
Any help would be useful for me.
Lokesha (4 Replies)
im a new student in programming and im stuck on this question so please please HELP ME. thanks.
the question is this:
enter a command to delete all files that have filenames starting with labtest, except labtest itself (delete all files startign with 'labtest' followed by one or more... (2 Replies)
Hi All ,
I want to delete files from /tmp directory created by "xxxx" id.
because i got the list says more than 60 thousand files were created by "xxxx" id since 2002.
The /tmp directory has lot of files created by different user ids like root,system etc..
But, i need a script to... (2 Replies)
I wrote a script to delete files which are older than "x" days, if the size of the directory is greater than "y"
#!/bin/bash
du -hs $1
while read SIZE ENTRY
do
if ;
then
find $1 -mtime +$2 -exec rm -f {} \;
echo "Files older than $2 days deleted"
else
echo "free Space available"... (4 Replies)
Hi,
I have line in input file as below:
3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL
My expected output for line in the file must be :
"1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL"
Can someone... (7 Replies)
logs:
"/home/abc/public_html/index.php"
"/home/abc/public_html/index.php"
"/home/xyz/public_html/index.php"
"/home/xyz/public_html/index.php"
"/home/xyz/public_html/index.php"
how to use "cut" or "awk" or "sed" to get the following result:
abc
abc
xyz
xyz
xyz (8 Replies)
Hello.
Following recommendations for one of my threads, this is working perfectly :
#!/bin/bash
CNT=$( grep -c -e "some text 1" -e "some text 2" -e "some text 3" "/tmp/log_file.txt" )
Now I need a grep success for some thing like :
#!/bin/bash
CNT=$( grep -c -e "some text_1... (4 Replies)
I have a bunch of random character lines like ABCEDFG. I want to find all lines with "A" and then change any "E" to "X" in the same line. ALL lines with "A" will have an "X" somewhere in it. I have tried sed awk and vi editor. I get close, not quite there. I know someone has already solved this... (10 Replies)
Hello.
System : opensuse leap 42.3
I have a bash script that build a text file.
I would like the last command doing :
print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt
where :
print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies
LEARN ABOUT MOJAVE
faxcron
FAXCRON(8) System Manager's Manual FAXCRON(8)NAME
faxcron - HylaFAX routine maintenance script
SYNOPSIS
/usr/sbin/faxcron [ -n ] [ -l lastrun ]
DESCRIPTION
faxcron is a command script that does routine upkeep tasks in a HylaFAX spooling directory hierarchy. This script is intended to be
invoked from cron(8) on behalf of the fax user (often the ``fax'' user is uucp) once a day, with the standard output sent by mail to the
HylaFAX administrator. For example, the following crontab might be set up for the fax user:
25 23 * * * sh /usr/sbin/faxcron | mail FaxMaster
The faxcron script does the following work:
o report statistics for facsimile transmitted since the last time faxcron was run.
o report statistics for facsimile transmitted in the past week.
o report statistics for facsimile received since the last time faxcron was run.
o report statistics for facsimile received in the past week.
o report any recent calls that failed suspiciously and return the associated trace log;
o purge data that is 30 days or older from the remote machine information directory;
o delete information that is 30 days or older from session trace log files;
o remove files from the tmp directory that are older than 1 day;
o remove files in the received facsimile queue that are 7 days or older;
o report sites that are currently having jobs rejected; and
o force all session log files to be owned by the fax user and kept with protection mode 644.
OPTIONS -n Forces faxcron to run without updating any files.
-l lastrun
Forces the notion of the last time that faxcron was run to be lastrun. The value of lastrun is a date and time string of the
form ``MM/DD/YY HH:MM'' (the date(1) format string ``%D %H:%M'').
-info n Set the expiration time for data in the info database to be n days.
-log n Set the expiration time for session log data to be n days.
-rcv n Set the expiration time for files in the received facsimile queue to be n days.
-tmp n Set the expiration time for files in the tmp directory to be n days.
-mode m Set the file protection mode for session logs to m (a command line argument to chmod(1)).
NOTES
This script requires nawk(1) or gawk(1) and a date (1) program that supports the ``+format'' option.
If session logs are to be kept private this script must be modified to filter out sensitive information such as calling card numbers. (It
should also be run with ``-mode 0600'' so that session log files are not publicly readable.)
FILES
/var/spool/hylafax spooling area
/var/spool/hylafax/status/lastrun timestamp of last run
/usr/sbin/xferfaxstats for generating transmit statistics
/usr/sbin/recvstats for generating receive statistics
/var/spool/hylafax/tmp/faxcronXXXX temporary file for truncating session logs
/var/spool/hylafax/tmp/faxlogXXXX temporary file for logs of failed calls
SEE ALSO cron(8), faxq(8), faxgetty(8), faxsend(8), xferfaxstats(8), recvstats(8), hylafax-server(5)
May 12, 1996 FAXCRON(8)