Hi All,
I am ftping to a windows box where i will be going to a specific directory and check whether file is existing or not. If file exists, get the file to my UNIX box else, say that file didn't exist and touch a new file in UNIX box.
Here is what i tried the code:
This is FTP script.
ftp -n <<EOF
open windowsboxname
user --> User credintials.
cd FTPT1
pwd
ls
#Somewhere over here i need to check the file existance. If true get the file else touch #a new file,
get $2 $1/"$2"
rename $2 Archive/`date '+%Y_%m_%d'`"_"$2
quit
EOF
$2 is the file.
I am not sure where to include the code in such a way that the new file will be created if file doesn't exist.
Thanks in advance.