Error reporting script

I am very new to unix/linux and am unsure how to do the following tasks within my script

1) append a log file and add a timestamped echo "Error occured" to it, if posibble to print it to file and on screen at the same time would be even better.
2) As my main script will be calling on a couple of my other scripts I want to create a setup file so i can take my setup script from site to site and have it write the 2 or 3 scripts that it needs to. What command should i use to make the setup file write a section of script to a new file?
e.g. lines 5-8 to file called "login_script"

K thanks, i have probably asked some really easy questions so please forgive my noobness :slight_smile:

man tee