On Tue, 2003-08-26 at 00:13, Peram's List wrote:
> Hi Gurus,
> I need help with a script to transfer files from a linux box running RH
> 8.0 from a windows 2000 box.The sequence is as follows:
> 1. Ftp into the windows server, check for the existance of map* files in
> ftp dir, if yes move the files to the files to Archives folder with a
> date stamp.
> 2. Once the files on the windows server have been archived, the map*
> files should be copied to the destination dir.
> 3. After the files have been copied successfully, the files on the linux
> box need to be deleted.
>
> I'm stuck in the first step itself as I'm not able to find any option to
> move the files on the windows box from the script. The only other option
> I see is run a batch job on the Windows box. I'd appreciate if you can
> help me with suggestions/links to help me write the script on the Linux
> side.
>
> Regards,
>
> Peram
>
I have been using this script (getftp) for a long time. Change it a
little and you could have a sendftp script.
#!/bin/sh
# /****************************************************/
# /****************************************************/
# /**** Program ID: gftp ****/
# /**** Description: non interactive ftp ****/
# /**** By: rdh Date: 04/22/1996 ****/
# /**** Specs: ftp a file non interactively ****/
# /**** from 1 machine to another ****/
# /****************************************************/
# /****************************************************/
machine=$1
orig=$2
dest=$3
if [ "$machine" = "" ]
then
echo "usage: gftp machine origfile destfile"
exit
fi
if [ "$orig" = "" ]
then
echo "usage: gftp machine origfile destfile"
exit
fi
if [ "$dest" = "" ]
then
echo "usage: gftp machine origfile destfile"
exit
fi
start=`date`
echo $machine
echo $orig $dest
ftp $machine << eof
binary
prompt
hash
get $orig $dest
eof
--
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]
https://www.redhat.com/mailman/listinfo/redhat-list