Alternative formats
Automated File Transfers using the Canadian Intellectual Property Office's IP Horizons SFTP server
This guide contains a simplified description of automating the transfer of files using the Canadian Intellectual Property Office (CIPO) SFTP server. This guide will describe how to draft text file scripts for synchronization of files between CIPO's remote host and a local machine. A SFTP client is required. In this guide, the script examples make use of WinSCP, an open-source SFTP client for secure file transfers between a local and a remote computer.
WinSCP provides both simplified and detailed guides for automating file transfers and scripting.
If your organization has access to IT services, it would be important to consult it prior to implementing these instructions.
This guide includes:
Manual SFTP with WinSCP
WinSCP can be used to manually connect with CIPO's SFTP server and transfer files. In order to login, you require a host name, a user name, and a password.
The host name for CIPO's current SFTP server is: iphorizonspi.opic-cipo.ca
User names and passwords are sent to individual clients upon request.
Please consult your local IT service for help with additional settings that are unique to your IT configuration such as proxy settings.
Several directories have been created on the SFTP server to store IP data files.
IP data product | Remote Directory |
---|---|
Weekly files: patent bibliographic and full text | Patents_Bibliographic_Fulltext_Weekly |
Historical files: patent bibliographic and full text | Patents_Bibliographic_Fulltext_Historical_2019_01 |
Weekly files: patent administrative status | Patents_Administrative_Status_Weekly |
Historical files: patent administrative status | Patents_Administrative_Status_Historical_2019_01 |
Weekly files: patent biological sequence listing | Patents_Biological_Sequence_Listings_Weekly |
Historical files: patent biological sequence listings | Patents_Biological_Sequence_Listings_Historical_2019_06 |
Weekly files: patent applications images (MIMOSA) | Patents_Application_Images_Weekly |
Weekly files: patent grants images (MIMOSA) | Patents_Granted_Images_Weekly |
Weekly files: trademarks (XML / PNG) v1.5 | Trademarks_Weekly |
Historical files: trademarks (XML / PNG) v1.5 October 2019 | Trademarks_Historical_2019_10 |
Weekly files: Industrial designs | Industrial_Designs_Weekly |
Historical files: industrial designs september 2019 update | Industrial_Designs_Historical_2019_09 |
Manually log into our SFTP server to verify the most recent names of the folders used to store the data you wish to download. Folders for historical collections change with each new iteration in order to reflect the date of production.
Text File Scripts for Automated SFTP
You can create a text file using any text editor such as Notepad or Textpad.
Use the following template to create a script to transfer files from one or more remote directories. The symbol '#' is used for providing comments and annotation of scripts.
Command Script Template
# Opening an SFTP connection
# Following command opens an SFTP connection between local machine and SFTP server. Replace [User Name] and [Password] with the user name and password provided to you by CIPO.
open sftp://[User Name]:[Password]@iphorizonspi.opic-cipo.ca/ -hostkey="ssh-ed25519 256 wOX1WxRWVdy096BQNLi+T2VXtRLIvs1aS160SR3CguA=" -rawsettings ProxyMethod=3 ProxyHost="cdhwg01.prod.prv"
# Specify a remote source for file transfer
# Following command specifies the specific remote directory from which to transfer files from. Replace [Remote Directory] with the desired source directory
cd "/dev/cipo-d1/www/clients/client1/web3/web/cipo/client_downloads/[Remote Directory]"
# Specify a local destination for file transfer
# Following command specifies the local directory that will be the destination of the file transfer.
# Replace [Full path of local directory] with the full path of the local directory of the desired destination of the transferred files.
# Example: lcd "C:\SFTP_Destination\Patent Biblio Weekly"
lcd "[Full path of local directory]"
#Following command will transfer all files from the remote source directory to the local destination directory that has not already been previously transferred.
get -neweronly *.*
# Following command closes the SFTP connection
close
# Following command exits WinSCP
Exit
Example command script for automated SFTP.
#Download script for "Patent_Biblio_Weekly.txt"
open sftp://[User Name]:[Password]@iphorizonspi.opic-cipo.ca/ -hostkey="ssh-ed25519 256 wOX1WxRWVdy096BQNLi+T2VXtRLIvs1aS160SR3CguA=" -rawsettings ProxyMethod=3 ProxyHost="cdhwg01.prod.prv"
cd "/dev/cipo-d1/www/clients/client1/web3/web/cipo/client_downloads/Patents_Bibliographic_Fulltext_Weekly"
lcd "C:\SFTP_Destination\Patent Biblio Weekly"
get -neweronly *.*
close
exit
Important: All script files should be saved in the same location where the "WinSCP.exe" program file is located.
Batch File for running Scripts
Batch files contain a series of commands to be executed by the command-line interpreter. Batch files can be created in any text editor, and saved with the extension '.bat'. These files should be stored in the same location where "WinSCP.exe" and the script text files are located.
A batch file can be created to run any or all of the SFTP transfer scripts
Batch file command to run scripts
REM Replace [Filename#.txt] with the file name of the text file that contains the script for transferring files.
@echo off
winscp.com /ini=nul /script= [Filename1.txt]
winscp.com /ini=nul /script= [Filename2.txt]
winscp.com /ini=nul /script= [Filename3.txt]
REM Example: winscp.com /ini=nul /script= Patent_Biblio_Weekly.txt
Text scripts and batch files by opening the.bat file.
Once scripts and batch files are written and run successfully, batch files can be scheduled to run automatically using Task Scheduler. Resources can be found online to help accomplish this.
Running batch files with task scheduler.
2020Aussi offert en français sous le titre Transferts de fichiers automatisés depuis Horizons PI vers des lecteurs locaux au moyen du serveur Secure File Transfer Protocols (SFTP).