uses CGI module instead of parsing args
use tmp temporarily as logdir