Need help creating a script

Advertisement

rbreitman
Joined:
Posts:
1

Need help creating a script

We have an environment where each location scans into a directory structure on a local pc. They already have WINSCP and a profile that logs them into a Windows IIS-based SFTP server in user isolation mode. The user manually moves new files from the PC to the server. Unfortunately the users keep doing this incorrectly which is creating a lot of manual rework. Note that the files on the SFTP server are automatically processed and moved to another location (not on that server).

We would like to set up a script that runs periodically and copies (not move) files that are new since the last time the script ran from the pc to the server maintaining the directory structure...

Note that this runs in a HIPAA compliant environment and is an urgent need for my client. Please contact me if you can help.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,454
Location:
Prague, Czechia

Re: Need help creating a script

You can upload all files modified/created in a time range using:

put -filemask="*>=1D" c:\toupload\*

The above example uploads all files created in the last day (24 hours).

See https://winscp.net/eng/docs/file_mask

You can also use an absolute time like:

put -filemask="*>=2015-07-27 15:00:00" c:\toupload\*

For a general introduction to WinSCP scripting, see:
https://winscp.net/eng/docs/guide_automation

To schedule your script, see:
https://winscp.net/eng/docs/guide_schedule

Reply with quote

Advertisement

You can post new topics in this forum