how to write a shell program for back up

Hello..

I want to take back up from server to local machine and i dont know how to do it using cron and sftp . I can do it by manually typing password in the terminal and taking the back up. How to create a 'backup.sh' file for doing all the back up process and shut down automatically after that.???I am new in linux so only little experiance in shell scripting.

Search these forums for "exchange keys ssh" to find out how do it from a local machine. Read the man pages of "ssh" as well as "sftp" or "scp" - they all share a common mechanism of authenticating remote commands.

Regarding writing the backup mechanism itself: show what you have done so far and explain what your problems are.

As a general rule: when you ask specific questions you will get specific answers. Asking very general questions like you did will almost every time either produce answers of the type "read the man pages" or no answers at all. We will try to help you to a better understanding but not do your work for you. If you thought that somebody will write a backup-script for you: forget that instantly.

I hope this helps.

bakunin