Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
    
Can you show an example of the directory structures on both sides (local and remote)? –  slm Feb 10 '13 at 5: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 Answer 1

up vote 2 down vote accepted

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
share|improve this answer
    
That worked perfectly. Thank you very much. –  Astephen2 Feb 10 '13 at 20:02

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.