LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (http://www.linuxquestions.org/questions/linux-server-73/)
-   -   Limit rsync log output (http://www.linuxquestions.org/questions/linux-server-73/limit-rsync-log-output-821647/)

glennbtn 07-23-2010 03:52 AM

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

Cheers
Glenn

Guttorm 07-23-2010 04:44 AM

Hi

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.


All times are GMT -5. The time now is 04:32 PM.