Added function to write crontab file

and added debugging code to test it