Skip to main content
edited tags
Link
Source Link

How to synchronise a specific file to a remote FTP server using lftp?

I'm trying to synchronise one file (among other things) using lftp.

Even though the docs say that

--file=FILE mirror a single file or globbed group (e.g. /path/to/*.txt)

lftp still seems to synchronise all the files of the directory of the passed file.

I'm running this command:

lftp -c "set cmd:fail-exit true; set ftp:ssl-allow no; open gocamping;
mirror --reverse --no-perms --exclude=CVS/ --exclude=.cvsignore --delete --verbose=1 --file='/vol/Grozs/Manas vietnes/gocamping/vietne_050011/www/discounts/aaa.php' --target-directory=~/web/discounts;"

In directory /vol/Grozs/Manas vietnes/gocamping/vietne_050011/www/discounts/ there are also files ooo.php and uuu.php, and all three of them get transferred.

What am I doing wrong?