#topicpath ----- #contents * active cameras [#b14ea7b2] - webcam1 - webcam2 - webcam4 - webcam5 - webcam7 (?) - (?? tesnc0 @ receiver cabin) * transfer route [#de8b7fa4] webcams -> v1c -> mx2 -> www2 + webcam[1-5] -> astecntl@aste-v1c:/var/tmp/webcam?.jpg webcams ftp-put to astecntl@aste-v1c + (?? tesnc0 -> aste-v1c:/home/asteobs/tmp/webcam/tesnc0.jpg) + shrink file size -> aste-v1c:/var/tmp/webcam/webcam[1-5][a-c].jpg aste-v1c : /cosmos3/aste/nro/sbin/webcamd (/cosmos3/aste/nro/rc3.d/{S99astnrod,exetab,S99astwebcamd}, user:astecntl) + transferred to aste-mx2 & create web page aste-mx2{aste}52: crontab -l 0,4,8,12,16,20,24,28,32,36,40,44,48,52,56 * * * * /home/aste/webcam_www/webcam_www.sh (rsync asteobs@aste-v1c:/var/tmp/webcam/webcam??.jpg /home/aste/public_html/webcam/) + copied to www2.nao.ac.jp aste-mx2{aste}52: crontab -l 2,6,10,14,18,22,26,30,34,38,42,46,50,54,58 * * * * /home/aste/bin/rsync_aste_www2.sh webcam -up -exec (rsync /home/aste/public_html/webcam aste-www@www2:/store/www/wwwusers/aste-www/) * files [#t8af7467] - original -- aste-v1c:/var/tmp/webcam?.jpg -- 704x480x24BPP ~ 300kB - file size reduced -- /var/tmp/webcam/webcam[1-5][a-c].jpg -- 704x480x24BPP ~ 20kB * how to restart webcam daemon [#v9e4a740] +asteobs@aste-v1cにログイン +sudo /cosmos3/aste/nro/sbin/restart_webcam を実行 * scripts [#ced1e073] - /cosmos3/aste/nro/sbin/restart_webcam #!/bin/sh ################################################ # must be running on aste-v1c # hname=`hostname` if [ "$hname" != "aste-v1c" ]; then echo "invalid host $hname"; echo "must be run on aste-v1c"; exit fi ################################################ # delete collapsed files # webcam_tmp_fig_1=/var/tmp/webacam*.jpg webcam_tmp_fig_2=/var/tmp/webcam/webcam*.jpg cmd="/bin/rm -f $webcam_tmp_fig_1 $webcam_tmp_fig_2" echo $cmd; eval $cmd; ################################################ # restart daemon # /cosmos3/aste/nro/rc3.d/S99astwebcamd stop sleep 3 /cosmos3/aste/nro/rc3.d/S99astwebcamd start -/cosmos3/aste/nro/sbin/webcamd #!/bin/sh s_path=/var/tmp/ d_path=/var/tmp/webcam/ djpeg=/home/local/bin/djpeg cjpeg=/home/local/bin/cjpeg test -d $d_path || mkdir -p 777 $d_path webcam="webcam" while : ; do for n in 0 1 2 3 4 5 6 8 9 ; do src="$s_path/$webcam$n.jpg" out="$d_path/$webcam$n" if [ -f "$src" ]; then $djpeg -bmp $src | $cjpeg -quality 95 -outfile ${out}a.jpg $djpeg -bmp $src | $cjpeg -quality 70 -outfile ${out}b.jpg $djpeg -bmp $src | $cjpeg -quality 45 -outfile ${out}c.jpg chmod 666 ${out}*.jpg fi done sleep 50 done -/home/aste/webcam_www/webcam_www.sh #!/bin/sh fl="1c 2c 4c 5c" fp="webcam{1c,2c,4c,5c}.jpg" d=`date '+%Y%m%d'` t=`date '+%H%M'` wc="webcam_qlook.html" wp="webcam_plook.html" rhost=aste-v1c #---------------# # process check # #---------------# o=`pgrep -n webcam_www.sh` r=`pgrep -d " " webcam_www.sh` for p in $r; do if [ "$p" != "$o" ]; then pkill -P $p scp sleep 3 fi done #-----# # scp # #-----# cd /home/aste/public_html/webcam #r=`ping ${rhost}` #if [ "$r" != "${rhost} is alive" ]; then # exit #fi command="scp -q \"asteobs@${rhost}:/home/asteobs/tmp/webcam/${fp}\" ." if ! eval ${command}; then exit; fi for f in $fl; do if [ ! -f webcam${f}.jpg ]; then exit; fi s="/bin/cp webcam${f}.jpg current_${f}.jpg" eval $s #if [ ! -d ${d} ]; then mkdir ${d}; fi s="/bin/mv webcam${f}.jpg ${t}_${f}.jpg" eval $s done #---------# # current # #---------# touch $wc echo "<html>" > $wc echo "<head>" >> $wc echo "<title>ASTE Webcam (current)</title>" >> $wc echo "</head>" >> $wc echo "<body bgcolor=#000000>" >> $wc echo "<p>" >> $wc echo "<center>" >> $wc echo "<p>" >> $wc for f in $fl; do echo "<img src='${t}_${f}.jpg'>" >> $wc echo "<p>" >> $wc done echo "</center>" >> $wc echo "<p>" >> $wc echo "</body>" >> $wc echo "</html>" >> $wc #------# # past # #------# touch $wp echo "<html>" > $wp echo "<head>" >> $wp echo "<title>ASTE Webcam (past 12 hrs)</title>" >> $wp echo "</head>" >> $wp echo "<body bgcolor=#000000>" >> $wp echo "<p>" >> $wp echo "<center>" >> $wp echo "<p>" >> $wp # 4min * 180 / 60min = 12hrs gl=`/bin/ls -t ????_1c.jpg | head -180` for g in $gl; do t=`echo $g | awk -F'_' '{ print $1 }'` # 00,16,32,48 m=`echo "($t % 100) % 16" | bc` if [ "$m" = "0" ]; then s="" echo "<font color=#ffffff>GMT = ${t}</font><br>" >> $wp for f in $fl; do s="${s}<img src='${t}_${f}.jpg' height=25% width=25% alt=\"\">" done echo ${s} >> $wp echo "<hr>" >> $wp echo "<p>" >> $wp fi done echo "</center>" >> $wp echo "<p>" >> $wp echo "</body>" >> $wp echo "</html>" >> $wp #-----# # end # #-----#