Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

lftp mirror wrong return code

Tags:

sftp

lftp

I am using lftp mirror -R to sync a local dir to a remote sftp dir

Just to get myself super clarified, the script my i am running lftp -f is as follows

open sftp://hostname port
user username password
mirror -R local_dir sftp_dir
exit

However I keep getting exit code 1 from mirror -R,even though from the standard stdout it seem that it has successfully uploaded the file and I can verify that the files are indeed upload from sftp.

So just wondering why is that happening and how i can get correct exit code

like image 477
Xinwei Liu Avatar asked Aug 25 '26 04:08

Xinwei Liu


1 Answers

Non-zero exit code without error messages means that something has silently failed. Most often it is "chmod" operation. Try adding --no-perms option. To be sure, enable debug and see the interaction with the server.

like image 134
lav Avatar answered Aug 27 '26 00:08

lav