Re: Questions about mirror'ing a website
hi ya michelle
- the simple way to transfer files from "working" to the "live" area...
- just copy the changes
- using cron to transfer is bad because ...
a- your change might NOT yet be done at the time that
cron runs at midnight to update
- deleting the whole web tree is bad .. sometimes you can't assume the
transfer completed ... due to bad disk, power outage, network hiccup
loose ethernet wires wiggled...
- if it is extremely important to delete files on "live" than its
easiest to use "rsyn --delete ... " to delete files on the other system
( do this/that with ssh )
further, supposedly.. your old files will not be visible
on live, since its not referenced in the new site
eg ... one could do "index.html index.html.lastmonth"
just for keepsake ...
a simple way ... ( heheheehee )
----------------
cd /var/www ; wget -r http://working.foo.com
a better way ??? ( one of dozen ways to do "a better way"
- use http://www.foo.com ( live site -- /var/www )
- use http://working.foo.com
( working area /home/www.jade including separate cgi and gif dirs)
where /home/www.jade and /var/www uses the same or
peferably different cgi-bin, icons, man, gif directories
as configured in httpd.conf for the 2 different web servers
- transfering with a simple script from "working" to "live"
#!/bin/bash
#
# - avoid using cron .. unless you can guarantee the jobs are done
# when cron transfers form working to live
#
# - i dont care about "old files" that are still zombies
# on the new updated live
#
#
cd /home/jade/public_html/
# - should also include cgi-bin, gifs, ...
#
# look at the last time things changed till today
#
find * -type f -mtime "-last-time" -print \
| tar zcvf /var/www.today.tgz -T -
#
# keeps track of what was last updated/changed
# - depending on where you start your tar from
#
# you can than also trivially check it for defacements
# w/ md5sum /var/www
#
cd /var/www ; tar zxvfp ../www.today.tgz
chown -R www-data:www-data /var/www
#
#
# create a new md5sum for hourly sanity checking
#
ls -laR --full-time /var/www/* > /var/www.md5/lst.txt
md5sum /var/www/* > /var/www.md5/today.md5
#
#
# done transfering from working to live
c ya
alvin
On Fri, 22 Nov 2002, Michelle Storm wrote:
> I am just after suggestions on the best and/or most efficient means to
> mirror my website (exactly) from one location to another (currently on
> same computer, but eventually multiple computers).
>
> /var/www/ LIVE <- Actual site location
>
> /home/jade/public_html/ WORKING <- Modifications and verification
> prior to copying to /var/www
>
> I want to "mirror" Working --> Live
>
> A few things to keep in mind.
> 1) LIVE has a different "owner:group" than WORKING.
>
> 2) If I move/rename files or diretories, I need this updated.
>
> 3) It only has to update once every 24 hours. <- Probably cron to do this.
>
> 4) I will eventually have them on seperate computers so I can't just use
> the following which is what I am currently doing:
>
> ON a daily basis, I just manually copy and paste the following, as I
> don't trust this in a cronjob yet as I need to do it as root right
> now.
>
> a) rm -rf /var/www/*
> b) cp -vR /home/jade/public_html/* /var/www/
> c) chown -cR www-data:www-data /var/www
>
> I've searched through "dselect" and found the following, and am just
> looking for recommendations, or any suggestions for something better.
>
> The choices that look like they might work for what I want.
> 1) mirror - Keeps FTP archives up-to-date
> 2) fmirror - memory efficient ftp mirror program
> 3) ftpmirror - Mirroring directory hierarchy with FTP
>
>
> Almost but I can see a few problems here.
> 1) mirrordir - duplicate a directory by making a minimal set of changes
>
>
> --
> Michelle Alexia "Jade" Storm
> Dragon Impersonating a Human and failing.
>
Reply to: