Skip to content
ederag edited this page Jan 4, 2020 · 19 revisions

Troubleshooting

Make sure there is no mismatch between the running services and the launched hamster: remember to kill the hamster daemons when version changes.

Merging two hamster.db files

See https://github.com/projecthamster/hamster/issues/340#issuecomment-324387786

You may also like to try htool from https://github.com/GeraldJansen/hamster-tool/.

Creating a dummy hamster.db for demo/testing

Original request here. Taking advantage of the fact that the hamster DB can be swapped "live", you can easily create one as follows:

# make a backup copy of your current DB 
DBDIR=~/.local/share/hamster # or hamster-applet for older versions
cp $DBDIR/hamster.db ~/bu-hamster.db

# download empty template hamster.db and replace your live DB
wget https://github.com/projecthamster/hamster/tree/master/data/hamster.db
mv hamster.db $DBDIR

# add activities, test, etc.

# save the dummy DB and restore your backup copy
cp $DBDIR/hamster.db ~/dummy-hamster.db
cp ~/bu-hamster.db $DBDIR

Of course, to do more testing/demonstration, you'd need to put the dummy-hamster.db back as $DBDIR/hamster.db, which is a real bother. You could automate this with scripts, softlinks etc.. However, it would probably be best to have a separate environment for testing/demo, say a dedicated userid or a separate virtual environment.

To automate the creation of test cases with recent dates, one can create -nnn/+nnn relative timestamps in a bash script, as in the following example:

# function for relative timestamp (arg -nnn or +nnn minutes)
function rts() { echo $(date +%Y-%m-%d\ %H:%M -d"$1 minutes"); }
# test of embedded activities 
hamster track 'outer activity@test, testing embedded activies #dev' $(rts -60) $(rts -10)
hamster track 'inner activity@test #dev' $(rts -60) $(rts -30)
hamster track 'test@ABC/Cooker' $(rts +0) $(rts +30)
...
Clone this wiki locally