r268 - in html/trunk: . scripts

jhuntwork at linuxfromscratch.org jhuntwork at linuxfromscratch.org
Tue Jun 14 10:42:08 PDT 2005


Author: jhuntwork
Date: 2005-06-14 11:42:07 -0600 (Tue, 14 Jun 2005)
New Revision: 268

Added:
   html/trunk/scripts/
   html/trunk/scripts/lfs-ftp-rsync.sh
   html/trunk/scripts/lfs-rsync.sh
Modified:
   html/trunk/contribute.html
Log:
Fixed typo in contribute.html and added rsync scripts for mirrors.

Modified: html/trunk/contribute.html
===================================================================
--- html/trunk/contribute.html	2005-06-14 17:36:28 UTC (rev 267)
+++ html/trunk/contribute.html	2005-06-14 17:42:07 UTC (rev 268)
@@ -68,7 +68,7 @@
              hour at a randomly chosen time.
           </p>
           <p>For FTP mirrors, please download the
-             <a href="/scripts/lfs-ftp=rsync.sh">lfs-ftp-rsync.sh</a> script.  Next please ask
+             <a href="/scripts/lfs-ftp-rsync.sh">lfs-ftp-rsync.sh</a> script.  Next please ask
              for a hour to sync from the FTP Mirror Maintainer (E-mail below) and schedule this
              script to run twice a day at the scheduled times.
           </p>

Added: html/trunk/scripts/lfs-ftp-rsync.sh
===================================================================
--- html/trunk/scripts/lfs-ftp-rsync.sh	2005-06-14 17:36:28 UTC (rev 267)
+++ html/trunk/scripts/lfs-ftp-rsync.sh	2005-06-14 17:42:07 UTC (rev 268)
@@ -0,0 +1,27 @@
+#!/bin/sh
+# This script rsyncs a directory with a server and will log and mail the
+# output to a user. 
+# Parameters are needed in this order:
+
+NAME="LFS ftp archive"
+SITE=rsync.osuosl.org
+MODULE=lfs
+LOCAL=/local/path/
+LOG=/path/to/logfile
+USER=root  
+MAILER=/usr/bin/your_favorite_mailer
+
+OUTPUT=`rsync -clprtz --delete ${SITE}::${MODULE} ${LOCAL} 2>&1`
+
+if [ $? = 0 ]
+then
+    echo "Subject: rsync of ${NAME} on igwe.vub.ac.be OK" |${MAILER}
+${USER};
+    echo "Rsync succeeded of ${NAME} on" `date` >> ${LOG}
+else
+    (echo "Subject: rsync of ${NAME} on igwe.vub.ac.be FAILED"; echo -e "${OUTPUT}") |${MAILER} ${USER};
+    echo "Rsync failed of ${NAME} on" `date` >> ${LOG};
+    echo -e "${OUTPUT}" >> ${LOG}
+fi
+
+

Added: html/trunk/scripts/lfs-rsync.sh
===================================================================
--- html/trunk/scripts/lfs-rsync.sh	2005-06-14 17:36:28 UTC (rev 267)
+++ html/trunk/scripts/lfs-rsync.sh	2005-06-14 17:42:07 UTC (rev 268)
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+HTMLDIR=/var/www/htdocs/lfssite
+
+cd $HTMLDIR/timestamp
+oldstamp=$(cat timestamp)
+
+rsync -cr linuxfromscratch.org::lfs-timestamp .
+
+newstamp=$(cat timestamp)
+
+if [ $newstamp -gt $oldstamp ]; then
+	rsync -clprtz --delete linuxfromscratch.org::lfs-website $HTMLDIR
+fi
+




More information about the website mailing list