
240
|
Chapter 11: Backing Up Data
vacation-request.sxw
15198 100% 154.60kB/s 0:00:00 (5, 87.5% of 16)
sent 185942 bytes received 136 bytes 24810.40 bytes/sec
total size is 210691 speedup is 1.13
amy@desk12:~$
rsync tells us that it is considering 14 files. It backs up only five files, though, because
the other nine files are already on the backup server and have not been changed. This
output shows the progress output as 100 percent when the files are complete and
indicates how long each transfer took. On a high-speed LAN the transfer time will
usually be less than one second for small or medium-sized files. On slower connec-
tions or for very large files, you will see a progress status that gives the size and per-
centage transferred so far, and an estimate of time to completion.
Listing Files on the Backup Server
rsync can also provide a list of the files on the backup server. This is useful for verify-
ing whether new and important files are really there, as well as for finding files that
need to be restored because they’ve been lost or because the user needs to recover an
old version.
To get this listing, omit the
options and destination arguments. Here’s a simple bash
script that obtains the desired results:
#!/bin/bash
dest=server1
user=$(whoami)
cd || exit 1
rsync "${user}@${dest}:." | more
Running this script produces results similar to the following:
amy@desk12:~$ ./backlist
Password:
drwx------ 4096 ...