I'm using a shell script which executes
lftp mirror --reverse to upload files and directories to a remote server. Just before that it removes everything using
glob -a rm -r -f *. The problem is, it is not so fast. Whole operation takes couple of minutes, especially the recursive removal. I'm uploading few megabytes of data in a couple of hundred files, but most of them do not change. I'm connecting through FTPS protocol.
How to improve the performance of my script?
I was thinking about uploading only files that are new or were changed locally and at the same time removing the ones from the remote server that are not present on my local machine. Sadly, I don't know if it is possible or how to achieve it.
lftp $host << EOF user $username $password cd $destination_directory glob -a rm -r -f * mirror --reverse $local_directory . exit EOF