# To unbundle, run this file echo dump sed 's/.//' >dump <<'//GO.SYSIN DD dump' -#!/bin/rc - -# poor man's /n/dump -# -# push $home over to c:/plan9 - -c=/n/c: -p9=$c/plan9 -dirs=`{echo $home | sed 's;^/;;'} - -if (test ! -d $p9) - c: || exit c: - -date=`{date} -year=$date(6) -mon=$date(2) -day=$date(3) - -smon='s/Jan/01/ - s/Feb/02/ - s/Mar/03/ - s/Apr/04/ - s/May/05/ - s/Jun/06/ - s/Jul/07/ - s/Aug/08/ - s/Sep/09/ - s/Oct/10/ - s/Nov/11/ - s/Dec/12/' - -mon=`{echo $mon | sed -e $smon} - -if (~ $day ?) day=0$day - -d=$p9 - -for (i in $year $mon$day) { - d=$d/$i - - if (test ! -d $d) - mkdir $d || exit $d -} - -cd / || exit / - -tar c $dirs | @{cd $d && tar xv} //GO.SYSIN DD dump echo yep.ed sed 's/.//' >yep.ed <<'//GO.SYSIN DD yep.ed' -119c - last=`{ls -t $dump/$year|sed 1q} -. -106c - last=$dump/ ^ `{echo $1|sed 's/^-(....)/\1\//'} -. -103c - last=$dump/ ^ `{echo $year|sed 's/..$//'} ^ `{echo $1|sed 's/^-(..)/\1\//'} -. -100c - last=$dump/$year/ ^ `{echo $1|sed 's/^-//'} -. -97c - last=$dump/$year/$mon ^`{echo $1|sed 's/^-//'} -. -93c - last=$dump/$year/$mon ^`{echo $1|sed 's/^-/0/'} -. -89c - sed -e 's%... (...) (..) ..:..:.. ... (....)%$dump/\3/\1\2%' -e 'y/ /0/' -e $smon} -. -4,5c -if(! test -e $dump/2001) - c: -. -2a -dump=/n/c:/plan9 - -. //GO.SYSIN DD yep.ed