How do I within a korn script, write an ftp process that will send a file to another server and on the sendmail server, how do I write a korn sccript to execute sendmail. I want the sendmail korn script to pick up the file that was recently ftp'd to it and then email out.
All help will be greatly appreciated.
I think for the ftp process, the beginning will be:
file_to_ftp=/dir/subdir/file_to_ftp
if [ -f $file_to_ftp ]
then
ftp target_server
and I am lost here with the username and password.
bin
put $file_to_ftp /dir/subdir/DESTINATION
exit
fi
exit
And for the sendmail script:
EMAILFILE=/Dir/Subdir/file_to_email
if [ -f $file_to_email ]
then
cat /Dir/Subdir/file_to_email | mail -s SUBJECT_OF_EMAIL email@address.com
fi
exit
All help will be greatly appreciated.
I think for the ftp process, the beginning will be:
file_to_ftp=/dir/subdir/file_to_ftp
if [ -f $file_to_ftp ]
then
ftp target_server
and I am lost here with the username and password.
bin
put $file_to_ftp /dir/subdir/DESTINATION
exit
fi
exit
And for the sendmail script:
EMAILFILE=/Dir/Subdir/file_to_email
if [ -f $file_to_email ]
then
cat /Dir/Subdir/file_to_email | mail -s SUBJECT_OF_EMAIL email@address.com
fi
exit