Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 27 Oct 2003 17:54:25 +0000
From:      Matthew Seaman <m.seaman@infracaninophile.co.uk>
To:        "M.D. DeWar" <mark@s-wit.net>
Cc:        freebsd <freebsd-questions@freebsd.org>
Subject:   Re: rsync help
Message-ID:  <20031027175425.GB23138@happy-idiot-talk.infracaninophile.co.uk>
In-Reply-To: <009f01c39cab$8deb61e0$fb65a8c0@ocfl061>
References:  <009f01c39cab$8deb61e0$fb65a8c0@ocfl061>

next in thread | previous in thread | raw e-mail | index | archive | help

--nVMJ2NtxeReIH9PS
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Mon, Oct 27, 2003 at 11:58:30AM -0500, M.D. DeWar wrote:
> I would like to backup some website directorys on one machine to another
> machine.
> I have read the rsync man pages and some sites but am still confused about
> how the command line should be.
> I will only run it from the command line every so often.
>=20
> I have tried several ways but can't figure it out. I guess I am having
> issues with how the directories should be listed on the command line.
>=20
> One the server that is to be backed up the directory is
> /home/sites/www.domain.com/web - all files and other directories are below
> the /web  and in reading it seemed I should keep the trailing slash off.
>=20
> on the server that the files will be copied to the directory is
> /home/domain/website/
> If I understood right the trailing slash should be on this one.
>=20
> ./rsync -ae ssh
> newbiedummy@servertobebackedup.com:/home/sites/www.domain.com/web
> /home/domain/website/
>=20
> am I even close to being right ?

Hmmm... Having a trailing slash or not on the *target* directory
doesn't make much difference at all.  Having a trailing slash or not
on the *source* does make a difference.  Without the slash, the last
directory in the source path will be created in the target directory
and all of the contents copied relative to that.  With the slash, only
the contents of the source dir get copied across and end up directly
under the target directory.

I believe the command as you have written it will create

    /home/domain/website/web

on the target server, with all of the various content under that
=2E../web/ directory.

Also, under FreeBSD, you don't need '-e ssh' as that's the default.

I think what you may need is:

rsync -avx \
    newbiedummy@servertobebackedup.com:/home/sites/www.domain.com/web/
    /home/domain/website/

A couple of good things to do are a) use the -n 'dry-run' flag to see
what would happen given a particular command line and b) create some
dummy files and directories under /tmp, and use rsync(1) to copy them
around just on the local system:

    rsync -avx --delete /tmp/foo/ /tmp/bar/

which will soon give you an understanding of how the trailing slash
thing works.

	Cheers,

	Matthew

--=20
Dr Matthew J Seaman MA, D.Phil.                       26 The Paddocks
                                                      Savill Way
PGP: http://www.infracaninophile.co.uk/pgpkey         Marlow
Tel: +44 1628 476614                                  Bucks., SL7 1TH UK

--nVMJ2NtxeReIH9PS
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (FreeBSD)

iD8DBQE/nVvRdtESqEQa7a0RAjhJAJ9ko09wKh3SudQydUjGrexGtfQxAgCghALX
QH0g5xCqdkfC8opNCjI+/cU=
=GByV
-----END PGP SIGNATURE-----

--nVMJ2NtxeReIH9PS--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20031027175425.GB23138>