2

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?

heartbt
  • 21
  • 2

1 Answers1

0

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.

lav
  • 341
  • 3
  • 7