Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Re: Delete files at local if deleted from remote

clyded wrote:

Potential update to the code?
synchronize local local-directory remote-directory -filemask="|*.*_" -delete

That's correct.
clyded

Delete files at local if deleted from remote

Hi there,

I was wanting to achieve the following, could you please enlighten me?

Future
I'm wanting to sync local (target) directory with remote (source) directory. So:
[1] any files updated at remote should get downloaded to my local directory after the sync
[2] any files deleted at remote should get deleted in my local directory after the sync
[3] any files added at remote should get added to my local directory after the sync

Current
At the moment, with the code below, I'm getting [1] and [3] from the list above.
option batch abort

option confirm Off
open sftp://username:password@server -hostkey="ssh-rsa 2048 mac-address"
synchronize local local-directory remote-directory -filemask="|*.*_"
exit


How do I achieve Future scenario #[2]? I've read about using the
-delete

option, would that achieve the end result?

Potential update to the code?
synchronize local local-directory remote-directory -filemask="|*.*_" -delete


Thanks,
Clyde