Selasa, 17 Januari 2006

Simple Local Rsync Use

Earlier this month I posted how I use rdiff-backup to keep a copy of files on a remote system, along with incremental changes. I also have an external USB/Firewire 2.5 inch hard drive that holds older files. I decided I wanted to copy all of the files from my laptop hard drive that were not present on the external hard drive.

The local data is stored in /data and the external drive is located at /mnt. I keep identical directories on each partition.


orr:/home/richard$ ls /data
Recycled iso misc tmp writing
code lpc test vmware zip
documents media tgz work
orr:/home/richard$ ls /mnt
Recycled iso misc tmp writing
code lpc test vmware zip
documents media tgz work

I decided to use Rsync to get the files not on /mnt from /data to /mnt. In the following example I copy files involving the /data/documents directory.

orr:/data$ rsync -vr /data/documents/* /mnt/documents
building file list ... done
doc/DYNAMIC HOST CONFIGURATION PROTOCOL.doc
doc/Speaker Submission form.doc
doc/bejtlich_proposal_issa-denver_2005.doc
doc/bejtlich_proposal_technosecurity_2006.doc
...edited...
txt/why_CREATE.txt
xls/SCCNS_Chapters.xls
xls/remember.xls

sent 26401643 bytes received 2518 bytes 621274.38 bytes/sec
total size is 190958410 speedup is 7.23

When finished, /mnt/documents has all of the files it originally had, along with the new files found in /data/documents. I like this system because rsync will create new directories, if needed, on /mnt to hold new files.

Next I will burn the contents of the /mnt directories to DVD for long-term storage.

0 komentar:

Posting Komentar