Remote synchronize, delete removed files but not folders
Hi
I'm trying to set up a PowerShell script, which should synchronize multiple folders to an FTP server. My problem is, that one specific local folder should be synchronized to a remote subfolder, and therefore the subfolder gets deleted.
How do I do that, without losing the ability to delete files, which has been deleted in a local folder?
Lets say I need to do the following:
Local path | Remote path
\\server\folder1\subfolder1\ | /FTP server/folder1/subfolder1/
\\server\folder1\subfolder2\ | /FTP server/folder1/subfolder1/subsubfolder1/
There are several other subfolders in folder1, but I only need to sync subfolder1 and subfolder2. And if a file is deleted from the local path, is should also be deleted on the FTP.
My sync is like this:
I'm trying to set up a PowerShell script, which should synchronize multiple folders to an FTP server. My problem is, that one specific local folder should be synchronized to a remote subfolder, and therefore the subfolder gets deleted.
How do I do that, without losing the ability to delete files, which has been deleted in a local folder?
Lets say I need to do the following:
Local path | Remote path
\\server\folder1\subfolder1\ | /FTP server/folder1/subfolder1/
\\server\folder1\subfolder2\ | /FTP server/folder1/subfolder1/subsubfolder1/
There are several other subfolders in folder1, but I only need to sync subfolder1 and subfolder2. And if a file is deleted from the local path, is should also be deleted on the FTP.
My sync is like this:
# Synchronize files for ($i=0; $i -lt $localePathArray.length; $i++) { $synchronizationResult = $session.SynchronizeDirectories([WinSCP.SynchronizationMode]::Remote, $localePathArray[$i], $remotePathArray[$i], $True) }