#!/bin/rc
# uses datefmt; see /n/sources/contrib/anothy/src/cmd/datefmt.c
rfork en
if (~ $journal '')
journal=$home/lib/journal
if (! test -d $journal) {
echo 'No journal at ' $journal >[1=2]
exit badjournal
}
if (test $#* -lt 1) {
echo 'usage: ' $0 ' /working/directory' >[1=2]
exit usage
}
workdir=$1
now=`{datefmt %Y%m%d/%H%M}
entry=$journal/$now
mkdir -p $entry
dircp $workdir $entry
touch $entry/notes
if (! test -s $entry/notes)
B $entry/notes
echo 'Created journal entry ' $journal/$now
|