For part A, you'll want Cron. Tim Hoolihan has a good example of that in his answer.
For part B, you'll want a shell script. To make one, just make a textfile that starts with the following line:
#!/bin/bash
And then follow that with commands like you were typing into the shell. (Advanced tip: the #! syntax works for any command-line program, not just bash
.)
Once that's done, save it (it's recommended to use a .sh extension, but not at all neccessary), go to your shell and run chmod ugo+x filename.sh
, substituting the actual filename, of course. This will make it so your script can be executed.
Finally, just put the script in the crontab per Tim's answer.
Hope this helps.
2@Bobby: I wasn't giving Google as an answer. But thanks for playing. – Ignacio Vazquez-Abrams – 2010-10-22T18:13:00.277