in reply to SFTP Sync

Not a criticism of your code, but it would be more efficient to use rsync for this. It doesn't need to move the entire file if only a small portion has changed.