Ubuntu's performance : how to speed up ?

Russell Cook ruscook_oz at yahoo.com.au
Fri Feb 18 12:09:09 UTC 2005


Hi guys,
For those newbies, like me thinking of rsync. Here's what I've setup and 
have running at the moment. Note. I'm using the rsync daemon mode and 
haven't got this working across samba shares yet.

Each file or script below is bounded by **** filename **** so it's 
reasonably easy to piece together what I've done.

Russ's rsync setup.

The script I run from my home dir (note: remember to make executable)
**** sync.sh ******
#!/bin/sh
# change -Ca to - Cav to add verbosity to output.

if [ "$HOSTNAME" != iq.sydwest ] ; then
echo Syncing $HOSTNAME to IQ
sudo rsync -Caz  --exclude-from /home/ruscook/sync.exclude --include "*" 
/home/ iq::home
# echo Syncing IQ to $HOSTNAME
# sudo rsync -Caz  --exclude-from /home/ruscook/sync.exclude --include 
"*" iq::home/ /home
fi

if [ "$HOSTNAME" != proto ] ; then
echo Syncing $HOSTNAME to Proto
sudo rsync -Caz  --exclude-from /home/ruscook/sync.exclude --include "*" 
/home/ proto::home
# echo Syncing Proto to $HOSTNAME
# sudo rsync -Caz  --exclude-from /home/ruscook/sync.exclude --include 
"*" proto::home/ /home
fi

if [ "$HOSTNAME" != dalek ] ; then
echo Syncing $HOSTNAME to dalek
sudo rsync -Caz --exclude-from /home/ruscook/sync.exclude --include "*" 
/home/ dalek::home
# echo Syncing dalek to $HOSTNAME
# sudo rsync -Caz  --exclude-from /home/ruscook/sync.exclude --include 
"*" dalek::home/ /home
fi

if [ "$HOSTNAME" = dalek ] ; then
echo Syncing linux-dist from dalek to proto
sudo rsync -Ca /home/linux-dist/  proto::linux-dist
echo Syncing vm from dalek to proto
sudo rsync -Ca /home/vm/  proto::vm
fi

if [ "$HOSTNAME" = proto ] ; then
echo Syncing linux-dist from proto to dalek
sudo rsync -Ca /home/linux-dist/  dalek::linux-dist
echo Syncing vm from proto to dalek
sudo rsync -Ca /home/vm/  dalek::vm
fi
**** sync.sh ******



sync.exclude is the stuff I leave out of home dir copying. Mainly for 
fear of screwing up too many settings between machines - I'm still 
learning on some of this stuff. I do force, thunderbird and mozilla to 
sync though, so my message base, bookmarks etc are duplicated across 
machines.
As you can see from the sync.sh file above this sync.exclude file also 
resides in my home dir.
**** sync.exclude ****
lost+found/
linux-dist/
.Trash/
.Trash-root/
Documents and Settings/
vm/
tmp/
Desktop/
.kde/
Cache/
+ .thunderbird/
+ .mozilla-thunderbird/
+ .mozilla/
.*
.config/
.gnome/
.gconf/
.gconfd/
**** sync.exclude ****



Next this rsyndc.conf file goes in your /etc directory
Modify to suit the directory groups/parts of the tree you want to backup.
Note I've setup rsync to allow my private class A (10.1.1.x) network to 
connect. This simplifies security but can be a risk if you're not on a 
private IP range and behind a NAT/Firewall.
Also, you'll need to change the hosts allow to suit your IP range. The 
syntax I've used is only one way to use this option. man will give 
further details.
**** rsyncd.conf *****
hosts allow = 10.1.1.0/24
use chroot = no
max connections = 6
log file = /var/log/rsyncd.log
gid = nogroup
uid = root

[home]
   path = /home
   read only = false
   comment= home dir sync

[linux-dist]
   path = /home/linux-dist
   read only = false
   comment = linux dists

[vm]
   path = /home/vm
   read only = false
   comment = vm files

[opt]
   path = /opt
   read only = false
   comment = sync opt paths
**** rsyncd.conf *****


The /etc/defaults directory has an rsync script (put their by the system 
when rsync is installed). This needs to have the RSYNC_ENABLE line 
changed from the default of false to true.
**** rsync ****
# defaults file for rsync daemon mode

# start rsync in daemon mode from init.d script?
#  only allowed values are "true", "false", and "inetd"
#  Use "inetd" if you want to start the rsyncd from inetd,
#  all this does is prevent the init.d script from printing a message
#  about not starting rsyncd (you still need to modify inetd's config 
yourself).
RSYNC_ENABLE=true

# which file should be used as the configuration file for rsync.
# This file is used instead of the default /etc/rsyncd.conf
# RSYNC_CONFIG_FILE=

# what extra options to give rsync --daemon?
#  that excludes the --daemon; that's always done in the init.d script
#  Possibilities are:
#   --address=123.45.67.89        (bind to a specific IP address)
#   --port=8730                (bind to specified port; default 873)
RSYNC_OPTS=''

# Don't forget to create an appropriate config file,
# else the daemon will not start.
**** rsync ****


Below is an excerpt from the final file, the rsync script file in 
/etc/init.d this file also needs the RSYNC_ENABLE=false changed to 
RSYNC_ENABLE=true
**** rsync **** EXTRACT ONLY NOT WHOLE FILE
#! /bin/sh
set -e

# /etc/init.d/rsync: start and stop the rsync daemon

DAEMON=/usr/bin/rsync
RSYNC_ENABLE=true

**** rsync **** EXTRACT ONLY NOT WHOLE FILE


Finally, to start rsync open a terminal and type "sudo rsync start"

Kind Regards Russ
www.windsorcycles.com.au
(gedit/ubuntu/gFTP)



-------------- next part --------------
A non-text attachment was scrubbed...
Name: ruscook_oz.vcf
Type: text/x-vcard
Size: 125 bytes
Desc: not available
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20050218/2ae711a1/attachment.vcf>


More information about the ubuntu-users mailing list