4

I have a folder that contains multiple subdirectories. I would like to copy the contents of the folder over ftp (using lftp preferably) instead of the entire folder.

When I use the mirror command, it seems to copy the folder over, which means that my files are one level higher than expected.

Astephen2
  • 143
  • Can you show an example of the directory structures on both sides (local and remote)? – slm Feb 10 '13 at 05:49
  • No problem. Local side: public, which contains folder1, folder2, folder3, multiple files Server side: I have a folder www. My goal is to copy folder1, folder2, folder3 and the multiple files inside public directly to www. – Astephen2 Feb 10 '13 at 20:00

1 Answers1

5

I usually use this form of the command to download:

% lftp -e 'mirror <remote download dir> <local download dir>' -u <username>,<pass> -p <port> <hostname>

If you want the contents of the folder just add the trailing slash like so:

% lftp -e 'mirror /some/remote/directories/contents/ /my/home/downloads/somedir/.' -u joeuser ftp.remotesys.com
slm
  • 7,730