On Fri, 7 Sep 2012 at 11:25 -0000, Don Kuenz wrote:
> My FreeBSD host contains two directories /u and /disk2/u. The latter
> directory, /disk2/u ought to mirror the former directory, /u, but
> extraneous files now exist on /disk2/u.
> Can anybody think of a better way of doing this?
A couple others suggested rsync. Here is a sample command that I use
to mirror my local media collection to a second drive.
rsync -n --stats -vi -aHh -P --delete /data/media/. /media/4gh-media/media/
The '-n' option enables dry-run mode where needed changes are only
reported, not performed. This allows me to double check large updates
before being applied.
I also occasionally add the '-c' option which checksums the files to
better detect any bit rot in the mirror.
If mirroring onto a FAT/NTFS drive (so the drive can be read by my TV,
etc) you may also need options "--no-g --no-p --modify-window=2".
Stuart
--
I've never been lost; I was once bewildered for three days, but never lost!
-- Daniel Boone