My script is set up with this for lftp
lftp -p 2218 -u $login,$pass sftp://$host << EOF
set mirror:use-pget-n 5
mirror -c -P5 --depth-first --Remove-source-files --log=/home/dog/downloadsync.log $remote_dir $local_dir
And it works great, except it leaves empty folders on the remote directory EVERY STINKING TIME. I've tried without --depth-first
and it still will leave them.
I've tried adding a rmdir *
after the mirror, and before the quit, but it creates some serious problems if the script crashes [don't ask that story] Is there any solution?
Best Answer
Use lftp-4.7.1 and mirror --Move option. It will remove source files and empty folders. The option first appeared in lftp-4.7.0.