I used computer 'A' to remotely access computer 'B'.

And I want get all files in directory1 including sub directory at computer 'A'.

But when I used mget -R *, that comments were shown (Not a regular file, No such file or directory)

Below, it is a my script. And it shows comments when I use the script.

<Script>

#!/bin/sh


HOST='IP'

USER='ID'

PASS='PASSWORD'


ftp -n $HOST << END_SCRIPT

user ${USER} ${PASS}

cd /RootDirectory

prompt

mget -R *

quit

END_SCRIPT


exit 0

<Comments>

user ID PASS

cd /RootDirectory

prompt

Interactive mode off.

mget -R *

directory2: Not a regular file

Directory and files information : Directory1 in RootDirectory / test01.sh ~ test05.sh, Directory2 in Directory1 / test06.sh ~ test07.sh in Directory2

I can't use 'wget'. What can I do something? Thanks for help :)

1

There are 1 best solutions below

0
On

Common ftp implementations do not support recursive transfers.

  • Either you will need to implement the recursive transfer on your own using some complex bash script on top of the ftp.
  • Or you will have to move to another FTP client.