Visit the LQ Articles and Editorials section
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 07-23-2010, 03:52 AM   #1
Registered: Dec 2009
Posts: 90

Rep: Reputation: 18
Limit rsync log output

Hi all

Is there a way to limit the amount of data that goes in to an rysnc log. The problem I have is that I email myself the log file to make sure it went ok but sometime the log is huge

Here is what I am doing with rsync
rsync -azHK --delete-after /home/ /mnt/usbbackup/home/ >/backup-log/backup.txt

Old 07-23-2010, 04:44 AM   #2
Senior Member
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,195

Rep: Reputation: 265Reputation: 265Reputation: 265

You could limit it with something like this:

rsync -azHK --delete-after /home/ /mnt/usbbackup/home/ |head -n 1000 >/backup-log/backup.txt

This will limit it to the 1000 first lines. Replace head with tail if you want the 1000 last lines, the last lines are probably more important. Personally I don't like email on successes at all, I just put the rsync line in cron, and I get emails on errors only.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
(Bash) Redirect all output from script to all.log and copy of errors to err.log hmsdefender Programming 5 03-05-2010 01:52 PM
Clean Up Log - Search for Pattern in Log file and Output result bridrod Linux - Newbie 10 01-05-2010 09:49 AM
set speed limit to rsync? malo_umoran Linux - General 7 08-27-2009 12:39 AM
rsync output for a report DaveQB Linux - Server 0 08-24-2009 01:11 AM
How to limit/control console output? jaristr Linux - Newbie 5 08-28-2005 03:10 PM

All times are GMT -5. The time now is 09:42 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration