various bug fixes for ubuntu (mv file, etc.)

1. write to local file, then move, don't try to overwrite file
2. always remove old cron entry before continuing