One of the problems with using a cron to automate tasks in Linux is losing the user environment.
With one of my recent projects I've been using expect to automate some uploading to my webserver rather then setting up SSH keys (out of pure laziness). I've been taking a picture from a webcam and uploading it to my web server every 10 minutes of every day, something that I don't want to do manually.
Using expect without the user environment for some reason also means the loss of the interact; command. I've yet to discover why*, so instead of using interact; I had to use expect eof; exit;
What I have been using
spawn "scp skycam.jpg [User]@[IP]:./uploads/skycam" expect Password send "[Password]" interact
What I should be using
spawn "scp skycam.jpg [User]@[IP]:./uploads/skycam" expect Password send "[Password]" expect eof exit
And just for the record, I've now switched to using SSH keys.