Consider taking base directory from parameters. I don't like /tmp/ is being used. I like being able to see the logs for last week or even month if needed.