[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Questions about mirror'ing a website



hiya,

i think what you really want is rsync.  you can do something like

su webuser -c "rsync -avP /workingdir /livedir"
(a is for preserve time/ownership/etc, vP is for a verbose status
report)

i believe that this way rsync will preserve all attributes except for
ownership, assuming that your webuser is a non-root account.  the nice
thing about rsync is that it only copies over the changed/new files,
possibly saving tons of disk activity/bandwidth.

> 1) LIVE has a different "owner:group" than WORKING.

i think su'ing to that user will do the trick, otherwise a chown -R.
it's also possibly that you can specify which attributes specifically
to preserve, but i'd have to do some fine manual page reading.

> 2) If I move/rename files or diretories, I need this updated.

rsync --delete will delete files/directories in the dest dir that don't
exist in the source dir.  i recommend using EXTREME caution with this
option though.  a good way to test is to add -n to the call to rsync,
which does a dry run telling everything it *would* do.

> 3) It only has to update once every 24 hours. <- Probably cron to do this.

i use rsync for stuff like this all the time

> 4) I will eventually have them on seperate computers so I can't just use
>    the following which is what I am currently doing:

rsync can do sync's over the net too.  the format is

rsync srcdir host:destdir

hth
	sean

Attachment: pgpPf_b_IZH8U.pgp
Description: PGP signature


Reply to: