You are not logged in. Login Now
 0-5          
 
Author Message
bwh
fronttalk: getting new items = 0 Mark Unseen   May 11 13:58 UTC 2019

In case this is of interest or use to anyone:

I went on long tangent trying to get new items for all conferences to
zero.  Skipping to the end ... I used the following steps & script which
worked for most of the conferences except:  

3 conferences had 1 or more files with inconsistent permissions.

10 conferences had mismatches between the /cyberspace/grex/bbs/ 
directory name and ~/.cfdir/ file name. 

More details of exceptions after the script.

#### script start ####

grex$ cat bt-cfdir-recreate.bash 
#!/usr/local/bin/bash

cat <<'end'

These steps can be used to recreate the ~/.cfdir such that
for most of the existing conference all items will be marked 
unread. For 10 of the 105 conferences listed in the entrance
page this failed due to a name mismatch between between the
/cyberspace/grex/bbs/ directory name and ~/.cfdir/ file name.  
Read items for such conferences manually. Stderr output will
identify such conferences.

Before running this script do steps 1-3 manually.

1 move ~/.cfdir (delete later if all goes well)

2 open backtalk from a browser
  logon
  open each conference (no need to view any items)
  this creates .<conference>.cf files

3 cd ~/.cfdir
  ls -a .*.cf > ~/conflist.txt
  this creates a list of the file names

4 run this script

5 run the script described at & review the thead:
  Grex > Garage > #45: Backtalk Crash > Response #23

  For each name in $cfdirlst/conflist.txt this script parses 
  the bbs files at /cyberspace/grex/bbs/ to populate the file
  of the same name in ~/.cfdir. The lines added should result 
  in no conference items marked as unread when using backtalk
  (as of the time the files are created). 

  At the top of the script, edit the variables as desired.
  as desired.  To protect from an unintended result the script 
  will exit if ~/.cfdir exists. All other files in .cfdir 
  will be recreated by backtalk.

end

read -p 'Enter to continue or Ctrl+C to abort. '

cname='Bruce Hohl'        # your name here
cfdirlst='conflist.txt'   # see above

mkdir ~/.cfdir || { echo "Exiting script: move ~/.cfdir"; exit 1; }
chmod 777 ~/.cfdir  # must be accessible by cfadm/backtalk 

cd /cyberspace/grex/bbs/

while read d1; do 
    dn=${d1#.}; dn=${dn%.cf}  
    # convert to name used at /cyberspace/grex/bbs/
    # for the find command below

    echo '!<pr03>'  > ~/.cfdir/$d1
    echo "$cname"   >> ~/.cfdir/$d1
 
    for d2 in $(find $dn -name _[0-9]* -maxdepth 1); do
        f1="${d2##*_}"              # item_id
        f2="$(grep -c ^,R $d2)"     # post+responses
        f3="0"                      # last update
        echo "$f1 $f2 $f3" >> ~/.cfdir/$d1
    done

done < ~/$cfdirlst

# sort contents of files ascending (in case that matters)
ctmp=$(mktemp)
for f in ~/.cfdir/.*; do 
    > $ctmp; sort -g $f > $ctmp; cp $ctmp $f
done

# not sure why temp files appeared in various places
rm $ctmp ~/$(basename $ctmp) ~/.cfdir/$(basename $ctmp)

exit 0

#### script end ####

-------------------------------------------------------
Script errors and notes: 
-------------------------------------------------------
(1) Script errors:

Some permissions errors uncovered:
(would be nice to have these fixed)

grep: backtalk2/_4: Permission denied      fixme (a) 
grep: music4/_1: Permission denied         fixme (a) 
grep: music4/_2: Permission denied         fixme (a)
grep: music4/_4: Permission denied         fixme (a)
grep: music4/_7: Permission denied         fixme (a)
grep: politics/_123: Permission denied     fixme (a) (b)


Unfortunate mismatches between the /cyberspace/grex/bbs/ 
directory name and ~/.cfdir/ file name. Read items for 
these conferences manually.
(would be nice to avoid this going forward)

find: books1: No such file or directory    books
find: cars1: No such file or directory     cars
find: class1: No such file or directory    classified
find: cyberp: No such file or directory    cyberpunk
find: drfuz: No such file or directory     drfuzzy
find: fixit: No such file or directory     diy
find: inet: No such file or directory      internet
find: lang1: No such file or directory     language
find: synth: No such file or directory     synthesis
find: vomit: No such file or directory     regurge


(2) the script leaves empty tmp files in ~/ and ~/.dfdir
    not sure why ...

(a) Edit the .<conf>.cf file for these items to: item_id 0 0
    Otherwise the entrance page will not load.

(b) Got this error attempting to open Politics:
    ERROR: Bad magic number in item file 
    /cyberspace/grex/bbs/politics/_123 executing 
    "read_item" on line 272 of abalone/confhome.bt
5 responses total.
bwh
response 1 of 5: Mark Unseen   May 12 00:56 UTC 2019

Oops, what I really meant for the title was: 
backtalk: getting new items = 0

I've been mostly using the web interface (backtalk) so the above was
from that perspective.  Maybe this item also applies also to the text
(fronttalk) interface?  I've found the web interface (abalone with Ice
Blue) attractive and easy to use.  I've noticed a few niggles which I
hope to investigate.  It's actually pretty amazing that both interfaces
exist and have so much depth.
papa
response 2 of 5: Mark Unseen   May 12 13:04 UTC 2019

I got to new items = 0 with Fronttalk the old fashioned way. :)
bwh
response 3 of 5: Mark Unseen   May 12 19:37 UTC 2019

I'm fairly certain I saved no time going the fancy route!
It did give me the illusion of control over the machine.
papa
response 4 of 5: Mark Unseen   May 12 21:23 UTC 2019

You effort was praise-worthy. Congratulations. :)
bwh
response 5 of 5: Mark Unseen   May 24 13:50 UTC 2019

There is now "Version 2" of "fronttalk: getting new items = 0"
It has more complete results so less manual clean-up.

It is located here: 
  http://grex.org/~bwh/tools/
  bt-cfdir-new-eq-0.TXT         readme
  bt-cfdir-new-eq-0.bash        script
  bt-cfdir-new-eq-0.data        mapping file (needed)
  bt_conf_menu_map.gnumeric     mapping worksheet (not)

1 - Copy .bash and .data to your home directory
2 - Run the .bash script which uses the .data file (mappings).

Script output:
  grex$ ./bt-cfdir-new-eq-0.bash

  These steps can be used to recreate the ~/.cfdir such that
  for conferences properly included in the data file all items
  will be marked as read (new=0).

  Contents of the existing ~/.cfdir will be moved to ~/cfdir_bak
    delete later if result is good
    restore if result is not good

  After running the script read and review this item:
  Grex > Garage > #45: Backtalk Crash > Response #23

  Enter to continue or Ctrl+C to abort.
  Name to use in all conferences: Your Name

  [stderr output example]
  grep: backtalk2/_4: Permission denied
  grep: internet/_50: Permission denied
  grep: music4/_1: Permission denied
  grep: music4/_2: Permission denied
  grep: music4/_4: Permission denied
  grep: music4/_7: Permission denied
  grep: politics/_123: Permission denied

  See the readme for additional comments.
 0-5          
Response Not Possible: You are Not Logged In
 

- Backtalk version 1.3.30 - Copyright 1996-2006, Jan Wolter and Steve Weiss