#!/bin/sh
# ~jhs/bin/.sh/web_cp_local_bsd
# See also: pcbsd_monitor, pcbsd_md5

# echo "Caution: This might refetch some stuff needlessly ?"

. ~jhs/bin/.sh/web_cp_0_inc

# params="$params -filter netinstall"	# 2 x 4.5 Gig

base=`basename $0`
echo "Updated by: http://www.berklix.com/~jhs/bin/.sh/$base" \
			 > /pub/Dates/$base.last
echo "Started: `date -u +%Y-%m-%dT%H:%M:%SZ`" >> /pub/Dates/$base.last

# $sl ; $ht $params -O www.pcbsd.org http://www.mirrorservice.org/pub/pcbsd/9.0
	# du -s -k	2134986

# Fails:
# params="$params --robots=0"	# ignore robots.txt
# $sl ; $ht $params -O unixarchive http://http://unixarchive.cn-k.de
	# du -s -k	20808

echo "About to call $ht $params -O /pub/docs.freebsd.org \
	 http://docs.freebsd.org/en/"
	$sl ; $ht $params -O /pub/docs.freebsd.org \
	 http://docs.freebsd.org/en/

echo "About to call $ht $params -O /pub/FreeBSD-Archive/ \
 http://ftp-archive.freebsd.org/pub/FreeBSD-Archive/old-releases/i386/ISO-IMAGES"
$sl ; $ht $params -O /pub/FreeBSD-Archive/ \
 http://ftp-archive.freebsd.org/pub/FreeBSD-Archive/old-releases/i386/ISO-IMAGES

# Not yet turned on below, as:
#	- it would duplicate some of above
#	- it would duplicate some stuff scattered in eg:
#	  	/pub
#		FreeBSD
#		FreeBSD-Archive		from above
#		phk.freebsd.dk
#		www.freebsd.org
#	  that I should merge
# $sl ; $ht $params -O /pub/FreeBSD.httrack.JJLATER/ \
#	http://ftp.freebsd.org/pub/FreeBSD/releases/i386/ISO-IMAGES
# 2014-03-03 :
#	7.3
#	7.4
#	8.1
#	8.2
#	8.3
#	8.4
#	9.0
#	9.1
#	9.2

# See Also eg: ~jhs/bin/.sh/web_cp_local_distfiles

echo "Finished: `date -u +%Y-%m-%dT%H:%M:%SZ`" >> /pub/Dates/$base.last
echo "$base finished on `hostname -s` `date -u +%Y-%m-%dT%H:%M:%SZ`" | mail -s "Cron: `hostname -s`" jhs
