#!/bin/rc # 2018-04-04T21:06:55-0400 # Dump RSS feeds into werc/apps/barf entries. # Run from cron. rfork en name=$1 if(! ~ $name read tumblr){ echo guess again. >[1=2] exit usage } log=/usr/sl/lib/$name.err root=/usr/sl/www/werc/sites/$name.stanleylieber.com urls=/usr/sl/lib/$name rm $log >$log chmod +at $log { while(){ sleep 30 if(ps | grep -s -e 'Broken[ ]+rrss'){ {date; echo Kill Broken rrss} >>$log Kill rrss | rc } # sleep 300 # if(ps | grep -s -e 'Sleep[ ]+rrss'){ # {date; echo Kill Sleep rrss} >>$log # Kill rrss | rc # } } } & ofs=$ifs ifs=' ' { for(i in `{cat $urls}){ ifs=$ofs { j=`{echo $i} url=$j(1) tag=$j(2-) } alarm 60 rrss -f barf -r $root -t $"tag -u $"url >>[2]$log echo $"url $"tag >>$log } } for(i in `{f $root/src}){ chgrp www $i } {date; echo Kill rrss.barf} >>$log Kill rrss.barf | rc