rm temp files, change log file path in head