I need to download directory via FTP recursively and preserve file permissions. I use FTP for this task. For some reason lftp doesn't copy file and directory permissions. Documentation says that lftp does it by default. I've tried to use mirror command with --perms flag and set mirror:set-permissions on command, without any luck.
Below is the output of lftp:
myuser@myhostname:~/mydir$ lftp ftp://ftp-hostname
lftp ftp-hostname:~> login ftp_username
Password:
lftp ftp_username@ftp-hostname:~> cd public_html/wp-content
cd ok, cwd=/public_html/wp-content
lftp ftp_username@ftp-hostname:/public_html/wp-content> ls
drwxr-xr-x 8 ftp_username ftp_username 4096 Jan 26 17:16 .
drwxr-x--- 9 ftp_username 99 4096 Feb 5 15:56 ..
-rw-r--r-- 1 ftp_username ftp_username 30 Jan 9 2011 index.php
drwxr-xr-x 28 ftp_username ftp_username 4096 Jan 26 17:14 plugins
drwxr-xr-x 10 ftp_username ftp_username 4096 Jan 2 2011 themes
drwxr-xr-x 2 ftp_username ftp_username 4096 Jan 26 17:12 upgrade
drwxrwxrwx 7 ftp_username ftp_username 4096 Jan 1 2012 uploads
lftp ftp_username@ftp-hostname:/public_html/wp-content> mirror uploads
Total: 30 directories, 159 files, 0 symlinks
New: 159 files, 0 symlinks
3132003 bytes transferred in 24 seconds (129.8K/s)
lftp ftp_username@ftp-hostname:/public_html/wp-content> quit
myuser@myhostname:~/mydir$ ls -l
total 4
drwxr-xr-x 7 myuser myuser 4096 Jul 4 07:11 uploads
myuser@myhostname:~/mydir$
As you can see, uploads directory has 777 permissions on the server, but when I download it, it becomes 751. Can anyone help me?
Thanks.