Sponsored Content
Full Discussion: Email backup log
Top Forums Shell Programming and Scripting Email backup log Post 302815187 by bakunin on Friday 31st of May 2013 06:27:13 AM
Old 05-31-2013
Quote:
Originally Posted by Bdoydie
the problem is that in the log files the date is in the below format:
Code:
Fri May 31,2013 02:30

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

Code:
****************************************************************

Then it is easy: use "sed"s range capability to print/delete only the lines in certain range:

Code:
mydate="$(date +'<appropriate format string here>')"

sed -n '/'"$mydate"'/,/^\*\{25\}/ p' /path/to/logfile

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.

I hope this helps.

bakunin
 

10 More Discussions You Might Find Interesting

1. Solaris

creating log files for a backup script on solaris

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)
Discussion started by: valicon
3 Replies

2. Windows & DOS: Issues & Discussions

Backup Directories and SubDirectories with log using DOS

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)
Discussion started by: osramos
1 Replies

3. UNIX for Dummies Questions & Answers

where are my email log files

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)
Discussion started by: mstarcom
3 Replies

4. Shell Programming and Scripting

parsing email log

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)
Discussion started by: jjamd64
5 Replies

5. UNIX for Dummies Questions & Answers

Showing a daily backup job from a unique log file.

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)
Discussion started by: metalfreakbr
0 Replies

6. Shell Programming and Scripting

Email script when automatic backup is finsihed

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)
Discussion started by: Wizard_1979
5 Replies

7. Shell Programming and Scripting

How to take the backup of log basing on size

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)
Discussion started by: saiki
1 Replies

8. Shell Programming and Scripting

Need a Script - Parse the log backup

Hello all, I need a script to parse the backup logs. I am newbie to scripting, please help. (7 Replies)
Discussion started by: sandeep007
7 Replies

9. Shell Programming and Scripting

Capture all error message in Log file and send the Log file by email

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)
Discussion started by: dgmm
2 Replies

10. Shell Programming and Scripting

rsync backup mode(--backup) Are there any options to remove backup folders on successful deployment?

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)
Discussion started by: MVEERA
0 Replies
BACKUPNINJA(1)							backupninja package						    BACKUPNINJA(1)

NAME
BACKUPNINJA - A lightweight, extensible meta-backup system "a silent flower blossom death strike to lost data." SYNOPSIS
backupninja [ -h ] [ -d ] [ -n ] [ -t ] [ -f filename ] [ --run filename ] DESCRIPTION
Backupninja allows you to coordinate system backups by dropping a few simple configuration files into /etc/backup.d/. Most programs you might use for making backups don't have their own configuration file format. Backupninja provides a centralized way to configure and coor- dinate many different backup utilities. FEATURES
- easy to read ini style configuration files. - you can drop in scripts to handle new types of backups. - backup actions can be scheduled. - you can choose when status report emails are mailed to you (always, on warning, on error, never). - console-based wizard (ninjahelper) makes it easy to create backup action configuration files. - passwords are never sent via the command line to helper programs. - in order to backup a db or sql database, you cannot simply copy database files. backupninja helps you safely export the data to a format which you can backup. - works with Linux-Vservers. Backup types include: - secure, remote, incremental filesytem backup (via rdiff-backup). incremental data is compressed. permissions are retained even with an unpriviledged backup user. - basic system and hardware information. - encrypted remote backups (via duplicity). - safe backup of MySQL, PostgreSQL, OpenLDAP, and subversion databases. - burn CD/DVDs or create ISOs. OPTIONS
-h, --help Show summary of options -d, --debug Run in debug mode, where all log messages are output to the current shell. -f, --conffile CONF_FILE Use CONF_FILE for the main configuration instead of /etc/backupninja.conf -t, --test Run in test mode, no actions are actually taken. -n, --now Perform actions now, instead of when they might be scheduled. --run ACTION_FILE Runs the action configuration ACTION_FILE and exits. CONFIGURATION
General settings are configured in /etc/backupninja.conf. In this file you can set the log level and change the default directory loca- tions. See backupninja.conf(5). To preform the actual backup actions, backupninja processes each action configuration file in /etc/backup.d according to the file's suffix. See backup.d(5). EXAMPLE USAGE
Backupninja can be used to implement whatever backup strategy you choose. It is intended, however, to be used like so: First, databases are safely copied or exported to /var/backups. Often, you cannot make a file backup of a database while it is in use, hence the need to use special tools to make a safe copy or export into /var/backups. Then, vital parts of the file system, including /var/backups, are nightly pushed to a remote, off-site, hard disk (using rdiff-backup). The local user is root, but the remote user is not privileged. Hopefully, the remote filesystem is encrypted. In order for this to work (ie for diff-backup to run unattended), you must create ssh keys on the source server and copy the public key to the remote user's authorized keys file. For example: root@srchost# ssh-keygen -t rsa -b 4096 root@srchost# ssh-copy-id -i /root/.ssh/id_dsa.pub backup@desthost Now, you should be able to ssh from user 'root' on srchost to user 'backup' on desthost without specifying a password. When prompted for a password by ssh-keygen, just leave it blank by hitting return. The "wizard" ninjahelper(1) will walk you through these steps. FILES
/usr/sbin/backupninja main script /etc/backupninja.conf main configuration file; general options /etc/cron.d/backupninja runs main script hourly /etc/logrotate.d/backupninja rotates backupninja.log /etc/backup.d directory for configuration files /usr/share/backupninja directory for handler scripts /usr/share/doc/backupninja/examples example action configuration files. SEE ALSO
ninjahelper(1), backupninja.conf(5), backup.d(5), AUTHOR
BACKUPNINJA was written by the riseup.net collective. riseup October 10, 2005 BACKUPNINJA(1)
All times are GMT -4. The time now is 02:41 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy