ingestfile: bracket up variables
mmfunctions: fix double-use of $logdir for different things

This fixes a bug that threw significant logging files into an
unintended directory.