Hi,
I have a server which appends to two different backup logs, a summary and a full log,
I want to write a script which will email out this mornings backup,
the problem is that in the log files the date is in the below format:
the summary log file I can just use Head to get the data, but in the full log because the log is a different length each day is proving difficult,
In the full summary each days log is delimited by
I was trying to grep the full summary for the date and then using AWK print 500 lines below it, which works just not in the script,
the problem is that in the log files the date is in the below format:
See he man page of the "date" command, it shouldn't be so complicated to get the date in this format to compare it to the log contents.
Quote:
Originally Posted by Bdoydie
In the full summary each days log is delimited by
Then it is easy: use "sed"s range capability to print/delete only the lines in certain range:
The sed-invocation will only print the lines starting with the first line containing your date to a line starting with 25 asterisks (i haven't bothered to count your line, correct the number if necessary). If you want to delete the files from the log use the same method but use "d" instead of "p" as a command.
Ok here is a stupid question but i can never remember how to do it,
the script is working fine but for some reason it is duplicating some of the lines
How do you remove duplicate lines?
---------- Post updated at 03:53 PM ---------- Previous update was at 12:58 PM ----------
This is really strange,
I tried running the script and I dont get any response,
just goes back to the prompt,
This made me think there are no entries in the log file for today,
but if i run the date command by its self it displays the date the way it should
and if i then run:
It again works fine but not in the script
Hi Everyone,
we are running rsync with --backup mode, Are there any rsync options to remove backup folders on successful deployment?
Thanks in adv. (0 Replies)
Hi
I have a requirement to write a script to capture all errors in a Logfile and send the file in email.
If there is any error occurred the subject of email will be ERROR , If there are no error occurred the subject of email will be SUCCESS.
So I created a Log file and put the Appropriate... (2 Replies)
Hi All,
I have a small doubt, there is one process which is writing the log file. That log file is getting overwritten every 5 hours. As i donot want to lose the data, i want to write a script which will check the max. file size defined for the file and take the backup of the file before... (1 Reply)
Hello all,
i'm still new to this site and thought i might find some help here :).
lately i performed a script to make an automatic backup of some files in certain directories. the script looks something like this:
#! /bin/bash
##############VARIABLES
path=/export/home/cassi/Backup... (5 Replies)
Hi guys,
I´m a newbie in Linux, but I´m trying to solve some problems studying on my own, but I´ve had some problems with AWK.
Look, I have one single backup log file per server and I want to make a daily delection from the last backup job to show in a intranet of my work.
The log files are from... (0 Replies)
Can anyone give me some examples of how I can parse the following lines of text so that all characters up to and including the @ symbol are deleted? Also, any duplicates would need to be deleted in order to produce the desired output. Any help is much appreciated and explanations of any... (5 Replies)
I am trying to find the email log file that would have info on users downloading their pop mail. Our email is hosted on a unix server running apache. I am not sure the exact version of mail software running, but when I telnet to the mail server the response I get is this "+OK POP3 v2003.83rh... (3 Replies)
Hello.
I need to Backup an Directorie with Sub-directories and after that put in a log file.
Then i need to copy several files and have a log file to.
All that using old DOS. Could someone help ?
Thanks in advance (1 Reply)
I have a simple backup script that I am running to back up drives across the network. However I need to have detailed log files for this script such as time backup started, what was backed up, if there were any errors and the time that the backup was complete. I would also like the script to... (3 Replies)