This is part of the ongoing idea that i need to protect
my day to day work. My excuse for not doing this has
always been hey I only lost a days work. But that is
not really true, or rather some days are more important
that others. It may take me days to work back to that
day. and given the fact that so much of this work
i discribe is off the cuff it may take a month
before i can come back. so its never just a day.
the following comes from the book "the linux cookbook"
page 281 chapter 16.4 "Building an rsync Backup Server"
Problem
you wan users to back up their own data. But you really don't
want to give users shell accounts all over the place, just
so that they can do backups. You'd also like to make it easier
for them to share files, again without give all your users
shell accounts.
Solution
Use a dedicated PC for a central server, and run rsync in daemon mode.
Users will not need login accounts on the server, and you can use rsync's
own access controls and user authorization for security.
rsync must be installed on all machines.
First, on the rsync server, edit or create /etc/rsyncd.conf to create
an rsync module defining the archive:
#global settings
log file = /var/log/rsyncd.log
#modules
[backup_dir1]
path = /backups
comment = server1 archive
list = yes
read only = no
Make sure that /backups exists. Next, start rsync on the server in daemon mode:
# rsync --deamon
Now you can copy files from a remote machine to the server. In this example,
the remote PC is a "workstation" and the rsync server is "server1." First,
verify that the rsync server is accessible:
sue@workstation:~$ rsync server1::
backup_dir1 server1 archive
This command copies Sue's /spreadsheets directory to the module backup_dir1:
sue@workstation:~$ rsync -av spreadsheets server1::backup_dir
building file list.....done
spreadsheets/august03
spreadsheets/sept03
spreadsheets/oct_03
worte 126399 byets read 104 bytes 1522.0 bytes/sec
total size is 130228 speedup is 0.94
Now, view the nice, new uploaded files:
sue@workstation:~$ rsync server1::backup_dir
drwx----- 192 .....
[omitted by me]
Sue can easily retrieve files from server1 to her workstation:
sue@workstation:~$ rsync -av server1::backup_dir1/sept_03 ~/downloads
------
ok that is great but i want to do a relative mindless synchronization
------
some more excerpts from this book:
rsync server1::
Double colons are used when connecting to an rsync server running in
daemon mode. When you connect to an rsync server, you use the module
names, rather than the file paths.
rsync -av
-a means archive mode, This tells rsync to ocpy directories recursivle,
preserve permissions, copy symlinks,, preserve group, preserve owner, and perserve
timestamps. -a is the same as -rlptgoD. -v is vebose.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment