
252
|
Chapter 9, Administration and Automation
#83 Make Network Backups
HACK
perform a series of network backups that simply copy files from one
machine on the network to another.
Simple Single-Shot Backup
If you want to do a simple full backup of a directory, you can do it with a
single command by using secure copy (
scp). This little tool lets you copy a
number of files from one computer to another in a secure encrypted form.
One of the major benefits of
scp is that you can copy files across the Inter-
net; you are not limited just to computers on your local network. To use
scp,
you need to have the Secure SHell (SSH) daemon running on the machine
you are copying to and have the
scp program (which is part of the SSH pack-
age) on the computer you are copying from.
To get started, you can copy a directory full of work from your machine
martin to a machine called simon (if your hostnames are not resolvable, use
their IP addresses). You can do this with the following command:
foo@martin:~$ scp -r importantwork simon:/home/alan
This command uses scp to recursively (-r) copy the files within the
importantwork directory to the host
simon and into the /home/alan direc-
tory. Once you have entered the command, you see a status bar for each file
as it is transferred. This gives you a visual indication of the copy’s progress.
Elaborate Backups Using rsync
Using scp for backing up a configuration has a few inherent ...