Syncing files(mirroring). Script Stops after removing an extra files from destination.
When syncing files (mirror files) from a server to win10 local machine client the script stops. It’s encountering a problem removing extra files from client. Here is the script…
The local folder has some extra folders files that needs to be removed. (They have been copied in by a developer for testing). The script is to clean then files for the developer.
WinSCP seems to know the files need deleting and tries to delete them. But it stops the script with an error code:2. What’s interesting is the file does get deleted on the local machine, so it cannot be a Permissions thing. But the script stops anyway. If I run the script again it stops on the next file in the folder that needs deleting..
Does it look like it’s trying to delete the file twice? Any ideas as to the problem?
Here is a log file snippet…
Pete.
# automatically abort script on errors
Option batch abort
# Disable overwrite confirmations that conflict with the previous
Option confirm off
# Open
Open %2% -certificate=* -rawsettings Compression=1
Synchronize local -transfer=binary -mirror -criteria=either -filemask="|log.txt; Thumbs.db; desktop.ini" "%1%" "/Sesame Template" -delete
# Disconnect
Close
# Exit WinSCP
Exit
Option batch abort
# Disable overwrite confirmations that conflict with the previous
Option confirm off
# Open
Open %2% -certificate=* -rawsettings Compression=1
Synchronize local -transfer=binary -mirror -criteria=either -filemask="|log.txt; Thumbs.db; desktop.ini" "%1%" "/Sesame Template" -delete
# Disconnect
Close
# Exit WinSCP
Exit
The local folder has some extra folders files that needs to be removed. (They have been copied in by a developer for testing). The script is to clean then files for the developer.
WinSCP seems to know the files need deleting and tries to delete them. But it stops the script with an error code:2. What’s interesting is the file does get deleted on the local machine, so it cannot be a Permissions thing. But the script stops anyway. If I run the script again it stops on the next file in the folder that needs deleting..
Does it look like it’s trying to delete the file twice? Any ideas as to the problem?
Here is a log file snippet…
2019-02-07 17:50:58.825 Script: Synchronizing...
. 2019-02-07 17:50:58.826 Synchronizing local directory 'c:\sesame\Companions\Plugins\MonitorChart\' with remote directory '/Sesame Template/Companions/Plugins/MonitorChart/', params = 0x1403 (Delete, NoConfirmation, BySize, Mirror)
< 2019-02-07 17:50:58.828 Script: Local 'c:\sesame\Companions\Plugins\MonitorChart' <= Remote '/Sesame Template/Companions/Plugins/MonitorChart'
< 2019-02-07 17:50:58.828 Script: 'c:\sesame\Companions\Plugins\MonitorChart\DevExpress.Office.v18.1.Core.dll' deleted
. 2019-02-07 17:50:58.829 Synchronizing local directory 'c:\sesame\Companions\Plugins\MonitorChart\' with remote directory '/Sesame Template/Companions/plugins/MonitorChart/', params = 0x1403 (Delete, NoConfirmation, BySize, Mirror)
< 2019-02-07 17:50:58.834 Script: Error deleting file 'c:\sesame\Companions\Plugins\MonitorChart\DevExpress.Office.v18.1.Core.dll'.
< 2019-02-07 17:50:58.834 System Error. Code: 2.
. 2019-02-07 17:50:58.826 Synchronizing local directory 'c:\sesame\Companions\Plugins\MonitorChart\' with remote directory '/Sesame Template/Companions/Plugins/MonitorChart/', params = 0x1403 (Delete, NoConfirmation, BySize, Mirror)
< 2019-02-07 17:50:58.828 Script: Local 'c:\sesame\Companions\Plugins\MonitorChart' <= Remote '/Sesame Template/Companions/Plugins/MonitorChart'
< 2019-02-07 17:50:58.828 Script: 'c:\sesame\Companions\Plugins\MonitorChart\DevExpress.Office.v18.1.Core.dll' deleted
. 2019-02-07 17:50:58.829 Synchronizing local directory 'c:\sesame\Companions\Plugins\MonitorChart\' with remote directory '/Sesame Template/Companions/plugins/MonitorChart/', params = 0x1403 (Delete, NoConfirmation, BySize, Mirror)
< 2019-02-07 17:50:58.834 Script: Error deleting file 'c:\sesame\Companions\Plugins\MonitorChart\DevExpress.Office.v18.1.Core.dll'.
< 2019-02-07 17:50:58.834 System Error. Code: 2.
Pete.