HMC Homepage      CS Home

Mirroring a TWiki

To mirror a TWiki, you will copy the following script into the directory where you want the mirror of the TWiki:
#!/bin/sh

# This needs to be set to your web.
MYWEB=""

URL=http://www.cs.hmc.edu/twiki/bin/view/$MYWEB/
INCLUDE="/twiki/bin/view/$MYWEB"
EXCLUDE="/twiki/bin/*"
REJECT="*\\?rev*,*\\?sortcol*,*\\?raw*,*\\?skin*"
wget -erobots=off -I $INCLUDE -X $EXCLUDE -R $REJECT -r $URL -k

On the line MYWEB="", replace the quotes with the name of your web. For instance, if you wanted to mirror the CS105Fall2005 TWiki, you would have MYWEB=CS105Fall2005. You will then save the script with your web name added. If the script is not executable, then you will need to change its permissions. Type the following at the prompt to make mirror.sh executable:

%chmod 755 mirror.sh

Type ./mirror.sh and the script will create the mirror.

Password Protected TWiki

If you are attempting to mirror a password protected TWiki, such a clinic project, then you will need to use the following script:
#!/bin/sh

# This needs to be set to your web
MYWEB=""

URL=http://www.cs.hmc.edu/twiki/bin/viewauth/$MYWEB/
INCLUDE="/twiki/bin/viewauth/$MYWEB,/twiki/bin/view/$MYWEB,/twiki/pub/$MYWEB"
EXCLUDE="/twiki/bin/*"
REJECT="*\\?rev*,*\\?sortcol*,*\\?raw*,*\\?skin*"
wget -erobots=off -I $INCLUDE -X $EXCLUDE -R $REJECT -r $URL -k 

If you don't already have one, you will need to create a .wgetrc file and add the following lines to it:

http_user=YourWikiName
http_passwd=YourWikiPasswd

where YourWikiName and YourWikiPasswd are your username and password for accessing the TWiki page. From here, follow the directions above. Once the copy of the TWiki has been made, remove your TWiki name and password from your .wgetrc file.


HMC Computer Science Department
Contact Information
Last Modified Friday, 09-May-2008 14:37:51 PDT