r598 - html/trunk/external-scripts

archaic at linuxfromscratch.org archaic at linuxfromscratch.org
Tue Oct 18 11:24:09 PDT 2005


Author: archaic
Date: 2005-10-18 12:24:08 -0600 (Tue, 18 Oct 2005)
New Revision: 598

Modified:
   html/trunk/external-scripts/lfs-ftp-rsync.sh
   html/trunk/external-scripts/lfs-livecd-rsync.sh
   html/trunk/external-scripts/lfs-rsync.sh
Log:
Made rsync scripts RFC compliant WRT email format. Added sample LOG, USER, and MAILER values and made them conform with each other. Added stderr to lfs-rsync.sh logging.

Modified: html/trunk/external-scripts/lfs-ftp-rsync.sh
===================================================================
--- html/trunk/external-scripts/lfs-ftp-rsync.sh	2005-10-18 14:22:01 UTC (rev 597)
+++ html/trunk/external-scripts/lfs-ftp-rsync.sh	2005-10-18 18:24:08 UTC (rev 598)
@@ -6,19 +6,19 @@
 NAME="LFS FTP Archive"
 SITE=rsync.osuosl.org
 MODULE=lfs
-LOCAL=/local/path/   			# Edit this line
-LOG=/path/to/logfile 			# Edit this line
-USER=root  
-MAILER=/usr/bin/your_favorite_mailer 	# Edit this line
+LOCAL=/local/path/				# Edit this line
+LOG=/tmp/lfs_rsync-`date +%Y%m%d%H%M%S`		# Edit this line, if necessary
+USER=your at email.address				# Edit this line
+MAILER=/usr/sbin/sendmail			# Edit this line, if necessary
 
 OUTPUT=`rsync -lprtz --delete ${SITE}::${MODULE} ${LOCAL} 2>&1`
 
 if [ $? = 0 ]
 then
-    echo "Subject: rsync of ${NAME} OK" |${MAILER} ${USER};
-    echo "Rsync succeeded of ${NAME} on" `date` >> ${LOG}
+    echo -e "Subject: rsync of ${NAME} OK\n" |${MAILER} ${USER};
+    echo "Rsync of ${NAME} succeeded on" `date` >> ${LOG}
 else
-    (echo "Subject: rsync of ${NAME} FAILED"; echo -e "${OUTPUT}") |${MAILER} ${USER};
-    echo "Rsync failed of ${NAME} on" `date` >> ${LOG};
+    (echo -e "Subject: rsync of ${NAME} FAILED\n"; echo -e "${OUTPUT}") |${MAILER} ${USER};
+    echo "Rsync of ${NAME} failed on" `date` >> ${LOG};
     echo -e "${OUTPUT}" >> ${LOG}
 fi

Modified: html/trunk/external-scripts/lfs-livecd-rsync.sh
===================================================================
--- html/trunk/external-scripts/lfs-livecd-rsync.sh	2005-10-18 14:22:01 UTC (rev 597)
+++ html/trunk/external-scripts/lfs-livecd-rsync.sh	2005-10-18 18:24:08 UTC (rev 598)
@@ -6,19 +6,19 @@
 NAME="LFS LiveCD FTP Archive"
 SITE=rsync.osuosl.org
 MODULE=lfs-livecd
-LOCAL=/local/path/   			# Edit this line
-LOG=/path/to/logfile 			# Edit this line
-USER=root  
-MAILER=/usr/bin/your_favorite_mailer 	# Edit this line
+LOCAL=/local/path/				# Edit this line
+LOG=/tmp/livecd_rsync-`date +%Y%m%d%H%M%S`	# Edit this line, if necessary
+USER=your at email.address				# Edit this line
+MAILER=/usr/sbin/sendmail			# Edit this line, if necessary
 
 OUTPUT=`rsync -lprtz --delete ${SITE}::${MODULE} ${LOCAL} 2>&1`
 
 if [ $? = 0 ]
 then
-    echo "Subject: rsync of ${NAME} OK" |${MAILER} ${USER};
-    echo "Rsync succeeded of ${NAME} on" `date` >> ${LOG}
+    echo -e "Subject: rsync of ${NAME} OK\n" |${MAILER} ${USER};
+    echo "Rsync of ${NAME} succeeded on" `date` >> ${LOG}
 else
-    (echo "Subject: rsync of ${NAME} FAILED"; echo -e "${OUTPUT}") |${MAILER} ${USER};
-    echo "Rsync failed of ${NAME} on" `date` >> ${LOG};
+    (echo -e "Subject: rsync of ${NAME} FAILED\n"; echo -e "${OUTPUT}") |${MAILER} ${USER};
+    echo "Rsync of ${NAME} failed on" `date` >> ${LOG};
     echo -e "${OUTPUT}" >> ${LOG}
 fi

Modified: html/trunk/external-scripts/lfs-rsync.sh
===================================================================
--- html/trunk/external-scripts/lfs-rsync.sh	2005-10-18 14:22:01 UTC (rev 597)
+++ html/trunk/external-scripts/lfs-rsync.sh	2005-10-18 18:24:08 UTC (rev 598)
@@ -3,10 +3,10 @@
 SITE=linuxfromscratch.org
 MODULE=lfs-website
 LOCAL=/path/to/local/site	# Edit this line
-USER=admin@<your domain here>	# Edit this line
+USER=your at email.address		# Edit this line
 MAILER=/usr/sbin/sendmail	# Edit this line, if necessary
 
-OUTPUT=`rsync -clprtzv --delete ${SITE}::${MODULE} ${LOCAL}`
+OUTPUT=`rsync -clprtzv --delete ${SITE}::${MODULE} ${LOCAL} 2>&1`
 
 # Run the command and mail the results
-(echo "Subject: LFS HTTP Mirror Updated - RC $?"; echo -e "${OUTPUT}") | ${MAILER} ${USER};
+(echo -e "Subject: LFS HTTP Mirror Updated - exitcode = $?\n"; echo -e "${OUTPUT}") | ${MAILER} ${USER};




More information about the website mailing list