Alter script to leave remote folders in place

Advertisement

eurekatech
Joined:
Posts:
2
Location:
USA

Alter script to leave remote folders in place

I have a scheduled task in place calling a script to weekly retrieve .pdf and .835 files from a remote server. The script has the get command in it listed below:
get * "D:\remote-files" -filemask="*.835,*.pdf" -delete
The problem is that the script is grabbing these files but it is also deleting all of the folders that it finds on the FTP. Is there anyway to change this to grab .835 and .pdf from various folders, delete the files, and leave the folders in place on the remote server?

Thanks!

Reply with quote

Advertisement

eurekatech
Joined:
Posts:
2
Location:
USA

Script Update

I was able to improve the script some like this.

cd /public_html/script-test
lcd C:\winscp
get -filemask="*.835; *.pdf" -rawtransfersettings[1] ExcludeEmptyDirectories=1 * -delete

It now leaves the folders that have no files but still deletes the folders that has files in them. Will I need to go the the full blown powershell sync script?

Reply with quote

Advertisement

You can post new topics in this forum