I want to upload some files in a local folder to a remote folder thanks to the command line's ftp client lftp.
What I want :
In my local computer, I do have :
me@local $ tree
my-site
├── index.html
└── css/
When I go to my FTP server, I want to have :
me@ftp_server $ tree
dev-site/
├── index.html
└── css/
What I want to do is to upload the local content of the my-site
dir to the remote dev-site
dir; but not the my-site
dir itself. So I just want to upload files and remove this directory prefix name.
What I tried :
I tried this :
# On my local computer :
$ ls
my-site/
$ lftp -u username,passwd ftp.foobar.cmo -e "mirror -R -p my-site/ dev-site/ ; quit"
Sadly, it uploads to local my-site
dir into the remote dev-site
, like :
# On my remote ftp server :
$ tree
dev-site/
└── my-site/
├── index.html
└── css/
Workaround :
It works as excpected if I do :
# On my local computer :
$ cd my-site/
$ lftp -u username,passwd ftp.foobar.cmo -e "mirror -R -p ./ dev-site/ ; quit"
But I want to avoid this dirty cd
.
Question:
Is there any way to remove a directory prefix while uploading files, in order to upload the content of a directory and not the directory itself ?