Previous log and diff


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Previous log and diff
# 1  
Old 10-06-2008
Previous log and diff

Logs are created on a daily basis, the format of the log file is: servername_yymmdd. I need to check if there is a difference in the log created today with the previous one. I would appreciate help on how I can step back to the previous log and how can I test if there is a diff in the logs.

Thanks you.
# 2  
Old 10-06-2008
Code:
man diff

# 3  
Old 10-06-2008
There are dozens of examples finding yesterday's date on the forum. Try a search, or go to the FAQ and look up the thread on date arithmetic - datecalc script
# 4  
Old 10-06-2008
here is one example of finding yesterday's date :

Code:
date -d "yesterday" +"%d %b %Y"

# 5  
Old 10-06-2008
Thanks everyone, really appreciate your help
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Diff 3 files, but diff only their 2nd column

Guys i have 3 files, but i want to compare and diff only the 2nd column path=`/home/whois/doms` for i in `cat domain.tx` do whois $i| sed -n '/Registry Registrant ID:/,/Registrant Email:/p' > $path/$i.registrant whois $i| sed -n '/Registry Admin ID:/,/Admin Email:/p' > $path/$i.admin... (10 Replies)
Discussion started by: kenshinhimura
10 Replies

2. Shell Programming and Scripting

Remove previous line if next & previous lines have same 4th character.

I want to remove commands having no output. In below text file. bash-3.2$ cat abc_do_it.txt grpg10so>show trunk group all status grpg11so>show trunk group all status grpg12so>show trunk group all status GCPKNYAIGT73IMO 1440 1345 0 0 94 0 0 INSERVICE 93% 0%... (4 Replies)
Discussion started by: Raza Ali
4 Replies

3. Shell Programming and Scripting

Compressing previous log automatically

I want to create a script that will zip the previous log. Example. abc.log.2012.12.02 abc.log.2012.12.01.gzip abc.log If today is 2012.12.03 , my current log is abc.log and my previous date is 2012.12.02, i want abc.log.2012.12.02 to compress everytime I run the script. I can... (5 Replies)
Discussion started by: kaibiganmi
5 Replies

4. Shell Programming and Scripting

serach diff filename in diff location using shell scripting

Hi, I am new to shell scripting. please help me to find out the solution. I need a script where we need to read the text file(consists of all file names) and get the file names one by one and append the date suffix for each file name as 'yyyymmdd' . Then search each file if exists... (1 Reply)
Discussion started by: Lucky123
1 Replies

5. Shell Programming and Scripting

.procmailrc and uudeview (put attachments from diff senders to diff folders)

Moderator, please, delete this topic (1 Reply)
Discussion started by: optik77
1 Replies

6. Shell Programming and Scripting

check log for previous date

Hi, i want to check the log for previous date. For getting today's log I have written the script result=tot_max_`date+%y%m%d`.log Pls can anyone help on how to get for previous date. Thanks in Advance, Neha. (5 Replies)
Discussion started by: NehaKrish
5 Replies

7. Shell Programming and Scripting

Simulate SVN diff using plain diff

Hi, svn diff does not work very well with 2 local folders, so I am trying to do this diff using diff locally. since there's a bunch of meta files in an svn directory, I want to do a diff that excludes everything EXCEPT *.java files. there seems to be only an --exclude option, so I'm not sure... (3 Replies)
Discussion started by: ackbarr
3 Replies

8. Shell Programming and Scripting

diff file and previous version

Im trying to diff two files. The first one I will be given. The second one I must find based on previous version created. For instance here are the files file_1 - created 3/22/08 file_2 - created 3/23/08 file_3 - created 3/24/08 file_4 - created 3/25/08 then I... (1 Reply)
Discussion started by: bigboizvince
1 Replies

9. Shell Programming and Scripting

grep a log file to filter previous dates

Hi, I have problem of filtering a log file from my perl script. #cat /data/pinpe.csv_20070731 | nawk -v FS=, '{print $1','$18','$22','$26}' | grep -w 100 | grep -w 1 | nawk '{print $4}' Below is the output: 2009-06-16 2009-01-29 2009-06-02 2008-03-05 2007-08-05 2007-09-24... (5 Replies)
Discussion started by: pinpe
5 Replies

10. Shell Programming and Scripting

diff 2 files; output diff's to 3rd file

Hello, I want to compare two files. All records in file 2 that are not in file 1 should be output to file 3. For example: file 1 123 1234 123456 file 2 123 2345 23456 file 3 should have 2345 23456 I have looked at diff, bdiff, cmp, comm, diff3 without any luck! (2 Replies)
Discussion started by: blt123
2 Replies
Login or Register to Ask a Question