Annotation of loncom/build/install_web_site_cronjob, revision 1.2

1.1       harris41    1: #!/usr/bin/perl
                      2: 
                      3: =pod
                      4: 
                      5: =head1 NAME
                      6: 
                      7: install_web_site_cronjob - maintain install.lon-capa.org web-site every day
                      8: 
                      9: =head1 DESCRIPTION
                     10: 
                     11: This is a file that runs periodically on B<install.lon-capa.org>.
                     12: 
                     13: This file should be run by the 'loninst' user and be part of
                     14: the 'loninst' crontab entries (to view loninst crontab, login
                     15: as loninst and crontab C<-l>; to edit loninst crontab, login as
                     16: loninst and crontab C<-e>).
                     17: 
                     18: This file should be on the B<install.lon-capa.org> filesystem as
1.2     ! harris41   19: F</home/loninst/auto/install_web_site_cronjob>.
1.1       harris41   20: 
                     21: The current 'loninst' crontab entry is:
                     22: 
1.2     ! harris41   23: 13 16 * * *    /home/loninst/auto/install_web_site_cronjob
1.1       harris41   24: 
1.2     ! harris41   25: The main goal of B<install_web_site_cronjob> is to periodically produce the
1.1       harris41   26: tarball needed for LON-CAPA installation.
                     27: 
1.2     ! harris41   28: A secondary yet important function of B<install_web_site_cronjob> is that it
1.1       harris41   29: also refreshes the documentation present on the install.lon-capa.org
                     30: web site.
                     31: 
                     32: The coding of this script is a strange brew of shell commands
                     33: with perl.
                     34: 
                     35: =head1 AUTHOR
                     36: 
                     37: Scott Harrison 2002-07-19
                     38: 
                     39: =cut
                     40: 
                     41: # --------------------------------------------- Making the tarball distribution
                     42: `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;`;
                     43: 
                     44: # ---------------------------------------- Dynamically generating documentation
                     45: `cd /home/loninst/auto/loncapa/loncom/build; make pdfdoc`;
                     46: `cd /home/loninst/auto/loncapa/loncom/build; make doc`;
                     47: `cd /home/loninst/auto/loncapa/loncom/build; cp docs.tar.gz /home/loninst/public_html/docs/.`;
                     48: `cd /home/loninst/public_html/docs; tar xzf docs.tar.gz`;
                     49: 
                     50: # ------------------------------------ Copying over the latest unstable tarball
                     51: my $filename=`cd /home/loninst/auto; find loncapa -type f -name *.tar.gz -maxdepth 1`;
                     52: chomp($filename);
                     53: $filename=~/loncapa\/loncapa\-(.*?)\.tar\.gz/;
                     54: my $version=$1;
                     55: `cd /home/loninst/auto; cp -f loncapa/loncapa-$version.tar.gz ../public_html/versions/loncapa-$version-unstable.tar.gz`;
                     56: `cd /home/loninst/public_html/versions; rm -f loncapa-unstable.tar.gz; ln -s loncapa-$version-unstable.tar.gz loncapa-unstable.tar.gz`;
                     57: 
                     58: # ------------------ Updating the download page with the date of the last build
                     59: open(IN,"</home/loninst/public_html/docs/downloads/index.html");
                     60: my @lines=<IN>;
                     61: close(IN);
                     62: my $date=`date -I`; chomp($date);
                     63: my $text=join('',@lines);
                     64: $text=~s/loncapa-unstable\.tar\.gz\<\/a\>.*?\./loncapa-unstable\.tar\.gz\<\/a\> (generated $date)\./;
                     65: $text=~s/loncapa-current\.tar\.gz\<\/a\>.*?\./loncapa-current\.tar\.gz\<\/a\> (version $version)\./;
                     66: open(OUT,">/home/loninst/public_html/docs/downloads/index.html");
                     67: print(OUT $text);
                     68: close(OUT);

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>