#Make backup-archive of things not sede: # Copies files to /tmp/joshb/plan_joshb, then archives them and deletes the # files. cd HTDOCS="WWW" # directory holding files under ~/ #make "latest" (1) log web-page-root-dir (site, see below for only archive) echo "make log" echo 'latest changes
' > ~/${HTDOCS}/last_change.html
#deny write permissions
chmod -R og-w ~/${HTDOCS}
 #Note: `gfind` for GNU `find`
gfind ~/${HTDOCS}  -type f -iname '*' -printf '%TYy-%Tmm-%Tdd %Tl:%Tm:%TS %h/%f\n' | sort | sed -e 's/\/home\/j\/joshb\/WWW\/\(.*\)$/\1<\/a>/;' | sed -e '/"x\//d' | tail -40 >> ~/${HTDOCS}/last_change.html
echo '
' >> ~/${HTDOCS}/last_change.html #make archive echo "make archive" mkdir /tmp/joshb if test 0 != "${?}" then echo error making directory, aborting exit fi echo "decompress all .bz2" bzip2 --force --decompress ~/${HTDOCS}/*.bz2 echo "mkdir /tmp/joshb/plan_joshb" mkdir /tmp/joshb/plan_joshb chmod o+rx /tmp/joshb/plan_joshb #Change change-date date on index.html file: echo "change change date index.html" echo -e "/CHANGE_ME_TO_CHANGE_DATE/s/.*/<\!-- CHANGE_ME_TO_CHANGE_DATE --> last change: $( date --utc )\nw\nq" | ed ~/${HTDOCS}/index.html #set permissions chmod -R og+r ~/${HTDOCS} chmod og-rw ~/${HTDOCS}/x #Copy all direct files #./plan_joshb/*.xcf \ echo "cp all files /tmp/joshb/plan_joshb" cp -p \ ~/bin/cpbackup \ ./plan_joshb/19march2005_Brussel.html \ ./plan_joshb/19march2005_Brussel.jpg \ ./plan_joshb/19march2005_Brussel_small.jpg \ ./plan_joshb/26april2005_tvtext.html \ ./plan_joshb/26april2005_tvtext.jpg \ ./plan_joshb/26april2005_tvtext_small.jpg \ ./plan_joshb/2oct2004_Adam.html \ ./plan_joshb/2oct2004_Adam.jpg \ ./plan_joshb/2oct2004_Adam_small.jpg \ ./plan_joshb/D.A.V.I.D.jpg \ ./plan_joshb/DAVID.html \ ./plan_joshb/DAVID.jpg \ ./plan_joshb/DAVID_CoatOfTools.jpg \ ./plan_joshb/DAVID_CoatOfTools.small.jpg \ ./plan_joshb/DAVID_vs_usury.jpg \ ./plan_joshb/David.jpg \ ./plan_joshb/burn.jpg \ ./plan_joshb/calendar.html \ ./plan_joshb/capitalism.html \ ./plan_joshb/capitalism.jpg \ ./plan_joshb/david-sim.html \ ./plan_joshb/david-sim.jpg \ ./plan_joshb/Www \ ./plan_joshb/activism.html \ ./plan_joshb/animalwars.jpg \ ./plan_joshb/antispam-mail-delay.html \ ./plan_joshb/b \ ./plan_joshb/background.jpg \ ./plan_joshb/band.jpg \ ./plan_joshb/blackbox.jpg \ ./plan_joshb/book.html \ ./plan_joshb/book.icon.jpg \ ./plan_joshb/bookcover.jpg \ ./plan_joshb/cap1.jpg \ ./plan_joshb/cap2.jpg \ ./plan_joshb/cap3.jpg \ ./plan_joshb/cap4.jpg \ ./plan_joshb/capdemoc.jpg \ ./plan_joshb/cappeace.jpg \ ./plan_joshb/circles.icon.jpg \ ./plan_joshb/clock.icon.jpg \ ./plan_joshb/constitution-short.html \ ./plan_joshb/constitution.html \ ./plan_joshb/constitution.nl.html \ ./plan_joshb/constitution.ps \ ./plan_joshb/constitution.txt \ ./plan_joshb/critique.html \ ./plan_joshb/david.jpg \ ./plan_joshb/david_small.jpg \ ./plan_joshb/deco.jpg \ ./plan_joshb/degenerating_tradeeconomy.jpg \ ./plan_joshb/democracy-all.html \ ./plan_joshb/democracy.html \ ./plan_joshb/democracy.icon.jpg \ ./plan_joshb/democracy.jpg \ ./plan_joshb/democracy2.jpg \ ./plan_joshb/demonstration.html \ ./plan_joshb/demoshort.html \ ./plan_joshb/deserteur.jpg \ ./plan_joshb/discussion.html \ ./plan_joshb/disproof.html \ ./plan_joshb/end_capitalism.html \ ./plan_joshb/env \ ./plan_joshb/etc.html \ ./plan_joshb/evolutiongraphic.jpg \ ./plan_joshb/fish.jpg \ ./plan_joshb/flag.html \ ./plan_joshb/flag.jpg \ ./plan_joshb/flagcn.jpg \ ./plan_joshb/flagexample.jpg \ ./plan_joshb/fun_with_david.jpg \ ./plan_joshb/geld.jpg \ ./plan_joshb/government.country_council.jpg \ ./plan_joshb/government.further_local.jpg \ ./plan_joshb/government.king_elect.jpg \ ./plan_joshb/government.smallest_local.jpg \ ./plan_joshb/govmodel1.jpg \ ./plan_joshb/finance-by-gambler.jpg \ ./plan_joshb/help-translate.html \ ./plan_joshb/high_tech_implant.html \ ./plan_joshb/i \ ./plan_joshb/index.html \ ./plan_joshb/judaism_christianity_islam.jpg \ ./plan_joshb/jewlaw \ ./plan_joshb/keyboard_and_broomstick.jpg \ ./plan_joshb/keybroom_natural.jpg \ ./plan_joshb/last_change.html \ ./plan_joshb/light.icon.jpg \ ./plan_joshb/light1.jpg \ ./plan_joshb/light2.jpg \ ./plan_joshb/light3.jpg \ ./plan_joshb/light4.jpg \ ./plan_joshb/light5.jpg \ ./plan_joshb/links.html \ ./plan_joshb/lockknob.jpg \ ./plan_joshb/losing_money.jpg \ ./plan_joshb/maildlay-input \ ./plan_joshb/maildlay-report \ ./plan_joshb/maildlay-spool \ ./plan_joshb/manpages-nl.icon.jpg \ ./plan_joshb/markets.html \ ./plan_joshb/me.html \ ./plan_joshb/meeting_world_options.jpg \ ./plan_joshb/moses.html \ ./plan_joshb/naddi.icon.jpg \ ./plan_joshb/neturei.jpg \ ./plan_joshb/octopussy.jpg \ ./plan_joshb/offline.html \ ./plan_joshb/posts \ ./plan_joshb/relmap.jpg \ ./plan_joshb/reply_GR.html \ ./plan_joshb/reply_GR.pdf.gz \ ./plan_joshb/representative.html \ ./plan_joshb/revolution.html \ ./plan_joshb/sedeicon.jpg \ ./plan_joshb/sheet1.html \ ./plan_joshb/sheet1.nl.html \ ./plan_joshb/sheet1.nl.pdf \ ./plan_joshb/sheet1.nl.txt \ ./plan_joshb/sheet1.pdf \ ./plan_joshb/sheet1.txt \ ./plan_joshb/sheet2.html \ ./plan_joshb/sheet2.txt \ ./plan_joshb/socialism.html \ ./plan_joshb/soundinvestment.html \ ./plan_joshb/state_forms.txt \ ./plan_joshb/techanimalwars.jpg \ ./plan_joshb/techdarwin.icon.jpg \ ./plan_joshb/techdarwin_corrupt.html \ ./plan_joshb/technical_darwinism.html \ ./plan_joshb/technical_darwinism.nl.html \ ./plan_joshb/technological-progress.jpg \ ./plan_joshb/tik_tak.jpg \ ./plan_joshb/usenet.html \ ./plan_joshb/vicious_circles.jpg \ ./plan_joshb/vote_machine.html \ ./plan_joshb/war_based_dominance.jpg \ ./plan_joshb/waste.icon.jpg \ ./plan_joshb/wedge.jpg \ ./plan_joshb/what_about_me.html \ ./plan_joshb/workmore.jpg \ /tmp/joshb/plan_joshb #copy sub-directories echo "cp subdir cc" mkdir /tmp/joshb/plan_joshb/cc chmod o+rx /tmp/joshb/plan_joshb/cc cp -p ./plan_joshb/cc/no_cost.jpg ./plan_joshb/cc/clock* ./plan_joshb/cc/naddi* ./plan_joshb/cc/distribution.html /tmp/joshb/plan_joshb/cc echo "cp subdir book" mkdir /tmp/joshb/plan_joshb/book chmod o+rx /tmp/joshb/plan_joshb/book cp -p ./plan_joshb/book/* /tmp/joshb/plan_joshb/book echo "cp subdir aksie" mkdir /tmp/joshb/plan_joshb/aksie chmod o+rx /tmp/joshb/plan_joshb/aksie cp -pR ./plan_joshb/aksie/* /tmp/joshb/plan_joshb/aksie echo "cp subdir aksie/animal-instincts" mkdir /tmp/joshb/plan_joshb/aksie/animal-instincts chmod o+rx /tmp/joshb/plan_joshb/aksie/animal-instincts cp -p ./plan_joshb/aksie/animal-instincts/* /tmp/joshb/plan_joshb/aksie/animal-instincts/ echo "cp subdir petition" mkdir /tmp/joshb/plan_joshb/petition chmod o+rx /tmp/joshb/plan_joshb/petition cp -p ./plan_joshb/petition/* /tmp/joshb/plan_joshb/petition #make "latest" (2) log web-page-root-dir (for archive) #catch only files that actually are in archive echo "make log" echo 'latest changes
' > /tmp/joshb/plan_joshb/last_change.html
chmod go+r /tmp/joshb/plan_joshb/last_change.html
chmod go-w /tmp/joshb/plan_joshb/last_change.html
chown joshb.joshb /tmp/joshb/plan_joshb/last_change.html
 #Note: `gfind` for GNU `find`
gfind /tmp/joshb/plan_joshb -type f -iname '*' -printf '%TYy-%Tmm-%Tdd %Tl:%Tm:%TS %h/%f\n' | sort | tail -40 | sed -e 's/\/tmp\/joshb\/plan_joshb\/\(.*\)$/\1<\/a>/;/.*\/tmp\/joshb\/plan_joshb$/d;' >> /tmp/joshb/plan_joshb/last_change.html
#ls -lrt /tmp/joshb/plan_joshb | tail -40 | sed -e 's/[^ ]*$/&<\/a>/;' >> /tmp/joshb/plan_joshb/last_change.html
echo '
' >> /tmp/joshb/plan_joshb/last_change.html #make it work with a parallel unpacked sede-everything.tar.gz archive # > ls # ./plan_joshb ./sede echo "parallel sede archive ... make README" cd /tmp/joshb/plan_joshb ln -s ../sede ./sede # target doesn't exist unless sede-everything.tar.gz ln -s ../plan_joshb.tar.gz ./plan_joshb.tar.gz # links to source-tar itself echo "Site start link: ./plan_joshb/index.html" > /tmp/joshb/plan_joshb/README echo "Use with sede-everything.tar.gz archive:" >> /tmp/joshb/plan_joshb/README echo " Unpack it into the same directory, results in:" >> /tmp/joshb/plan_joshb/README echo " ./plan_joshb ./sede" >> /tmp/joshb/plan_joshb/README echo " ./plan_joshb/index.html links into ./sede using symlink." >> /tmp/joshb/plan_joshb/README echo "" >> /tmp/joshb/plan_joshb/README echo "A symlink in ./plan_joshb points to the source archive" >> /tmp/joshb/plan_joshb/README echo "plan_joshb.tar.gz itself, it is a link for browsers to" >> /tmp/joshb/plan_joshb/README echo "follow & download." >> /tmp/joshb/plan_joshb/README #deny write permissions chmod -R og-w /tmp/joshb/ #allow read permissions chmod -R o+r /tmp/joshb/ #make archive echo "tar -czvpf ~/${HTDOCS}/plan_joshb.tar.gz" cd /tmp/joshb tar -czvpf ~/${HTDOCS}/plan_joshb.tar.gz ./plan_joshb #make checksums echo "checksums ~/${HTDOCS}/plan_joshb.tar.gz" echo "" > ~/${HTDOCS}/plan_sig.asc openssl md5 ~/${HTDOCS}/plan_joshb.tar.gz >> ~/${HTDOCS}/plan_sig.asc openssl sha1 ~/${HTDOCS}/plan_joshb.tar.gz >> ~/${HTDOCS}/plan_sig.asc echo "" >> ~/${HTDOCS}/plan_sig.asc echo "permissions archive" #set permissions chmod og-wx ~/${HTDOCS}/plan_joshb.tar.gz chmod og+r ~/${HTDOCS}/plan_joshb.tar.gz #remove if test "${1}" = "nodel" then echo not-deleted else rm -R /tmp/joshb fi #check echo "check:" ls -l ~/${HTDOCS}/plan_joshb.tar.gz #deny permissions (paranoid) chmod -R og-w ~/${HTDOCS} echo "check, should yield nothing:" ls /tmp/joshb #check garbage