To automate a process

CAN ANYONE HELP TO SOLVE

i wann write a script to automate a process .i.e, to search files in the FTP server and
and if files are there and we hav to bring that files to our system.
After copying the files in our system we have to upload the data in the tables.

I have scripts to load the data into tables and to copy files from ftp to our system.

we use to run the scripts every day....

This whole process has to be automated.
tat means.... the script has to check evryday for the files in the FTP and if file is
present in the FTP it automatically brings the file into our system and it has to load the
data into tables.....
I had six scripts... we hav to automate this scripts one by one.....
Can anyone please help in this issue....

Thanks,
Nani

Break it down into pieces, work up from smallest pieces to the loop that does all:

mkdir /tmp/dload.$$
scp2 +C id@host:file_path* /tmp/dload.$$
ls /tmp/dload.$$/*|while read f
do
 my_loader $f
done
rm -rf /tmp/dload.$$

You write my_loader so it knows how to a) load each file to any or all applicable tables using table-specific scripts, and b) move the file to your archive directory, compressed. Tool scp2 is much more secure than ftp, has passwordless authentication and can compress +C during network transit.

If the target system does not support SSH, add an entry for the remote system in your man .netrc (linux) file. You can then do something like:

echo get file | ftp -p hostname

in your gather script.