Home
Reading
Searching
Subscribe
Sponsors
Statistics
Posting
Contact
Spam
Lists
Links
About
Hosting
Filtering
Features Download
Marketing
Archives
FAQ
Blog
 
Gmane
From: David Cantrell <david <at> cantrell.org.uk>
Subject: Re: nice rsync
Newsgroups: gmane.comp.sysutils.backup.rsnapshot.general
Date: Monday 18th June 2007 19:46:33 UTC (over 10 years ago)
Eric S. Johansson wrote:
> running version 1 .2.1 .  The problem is that rsync is taking up too much
CPU 
> time (99%) during a local backup.  How can I reduce the load?  I would be
okay 
> with nice 19 as it would let other things function while it runs full
tilt 
> otherwise.  Do I just modify the rsync_cmd to something like:
> 
> cmd_rsync       /usr/bin/nice -n 19 /usr/bin/rsync

A quick look at the code makes me think that that wouldn't work (I'll
explain why below).  But this will work:

  cmd_rsync	/path/to/nice-rsync-script

where the nice-rsync-script reads:

  #!/bin/sh
  /usr/bin/nice -n 19 /usr/bin/rsync $*

As for why you need to do that ...

we invoke rsync using perl's system() command, passing it an array of
values.  The first item in the array is deemed to be the command to
execute, the remainder are argument to it.  And the first item in the
array is whatever you set cmd_rsync to.  I doubt you have a file called
"nice -n 19 /usr/bin/rsync" in /usr/bin :-) and if you do, then please
let me know how you created it!

At some point, we might switch to doing a fork and exec instead of
system(), but it'll still work the same way.  In fact, system() is just
a convenient short-hand wrapper around fork/exec.

-- 
David Cantrell | Hero of the Information Age

There's a hole in the world like a great black pit
And the vermin of the world inhabit it
And its morals aren't worth what a pig could spit
And it goes by the name of London.

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
 
CD: 3ms