#!/usr/bin/perl =pod =head1 NAME install_web_site_cronjob - maintain install.lon-capa.org web-site every day =head1 DESCRIPTION This is a file that runs periodically on B. This file should be run by the 'loninst' user and be part of the 'loninst' crontab entries (to view loninst crontab, login as loninst and crontab C<-l>; to edit loninst crontab, login as loninst and crontab C<-e>). This file should be on the B filesystem as F. The current 'loninst' crontab entry is: 13 16 * * * /home/loninst/auto/install_web_site_cronjob The main goal of B is to periodically produce the unstable tarball needed for LON-CAPA installation. A secondary yet important function of B is that it also refreshes the documentation present on the install.lon-capa.org web site. It does depend on a file name LATEST-IS-something, where something is the latest release of loncapa, that file should also contain a string that will be used to date the release. The coding of this script is a strange brew of shell commands with perl. =head1 AUTHOR Scott Harrison 2002-07-19 =cut # --------------------------------------------- Making the tarball distribution #`cd /home/loninst/auto; export CVS_PASSFILE=/home/loninst/.cvspass; export CVSROOT=:pserver:scott\@localhost:/home/cvs; rm -Rf loncapa/[C][^V]*; rm -Rf loncapa/[^C]*; cvs -Q co loncapa; cd loncapa/loncom/build; make build 2>/dev/null; make tardist;`; `cd /home/loninst/auto; export CVS_PASSFILE=/home/loninst/.cvspass; export CVSROOT=:pserver:scott\@localhost:/home/cvs; rm -Rf loncapa-unstable; rm -Rf loncapa; cvs -Q export -r HEAD loncapa;`; open(OUT,'>/home/loninst/auto/loncapa/README'); print(OUT <; close(IN); # ------------------ Updating the download page with the date of the last build open(IN,"; close(IN); my $date=`date -I`; chomp($date); my $text=join('',@lines); $text=~s/loncapa-unstable\.tar\.gz\<\/a\>.*?\./loncapa-unstable\.tar\.gz\<\/a\> (generated $date)\./; $text=~s/LATESTVERSION/$version/g; $text=~s/LATESTDATE/$releasedate/g; open(OUT,">/home/loninst/public_html/docs/downloads/index.html"); print(OUT $text); close(OUT);