I have a situation where I'm downloading multiple files from a remote system and I need to start a process after all the files are downloaded completely. How can I achieve it.
Eg.
I have 6 files, file1, file2, file3.... file6. I need to start a script scrpt1 after all the files have successfully downloaded. I'm using commmand prompt FTP scripts to download files.
I would appreciate if someone can share knowledge on the same.
Best Regards,
Nag
Hi Anchal,
Thanks for your reply, the files will be created the moment it starts FTPing, but it does not mean the FTP is complete. How do we know that the FTP is complete ?
Regards,
Nag
---------- Post updated at 10:22 AM ---------- Previous update was at 10:21 AM ----------
Hi Anchal,
Thanks for your reply, the files will be created the moment it starts FTPing, but it does not mean the FTP is complete. How do we know that the FTP is complete ?
better way is to use advance ftp mechanism.
btw various work arround for that if you have normal ftp method.
you can capture the log and thn do grep/sed etc for finding out various messages related to transferred for failed.
something like:
count=$(grep -c "No such file or directory" ftp.log)
if [ "${count}" -eq 0 ]; then
echo "file(s) successfully transferred."
else
echo "unable to trasferred file(s):"
## if file is not found. you can grep the following message.
grep "No such file or directory" ftp.log |awk '{print $1}'
fi