Automating File Transfers from IP Horizons to local drives using Secure File Transfer Protocols (SFTP).

Alternative formats

Download Automating File Transfers from IP Horizons to local drives using Secure File Transfer Protocols (PDF, 245 KB 8 pages)

Copy of this publication

To obtain a copy of this publication, or to receive it in an alternate format (Braille, large print, etc.), please fill out the Publication Request form or contact:

ISED Citizen Services Centre
Innovation, Science and Economic Development Canada
C.D. Howe Building
235 Queen Street
Ottawa, ON  K1A 0H5
Canada

Telephone (toll-free in Canada): 1‑800‑328‑6189
Telephone (international): 613‑954‑5031
TTY (for hearing impaired): 1‑866‑694‑8389
Business hours: 8:30 a.m. to 5:00 p.m. (Eastern Time)
Email: ised-isde@ised-isde.gc.ca

 

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.

A sceenshot of the WinSCP login window.

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.

Names of Remote Directories for CIPO IP data products.
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.


Permission to reproduce

Except as otherwise specifically noted, the information in this publication may be reproduced, in part or in whole and by any means, without charge or further permission from the Department of Industry, provided that due diligence is exercised in ensuring the accuracy of the information reproduced; that the Department of Industry is identified as the source institution; and that the reproduction is not represented as an official version of the information reproduced, or as having been made in affiliation with, or with the endorsement of, the Department of Industry.

For permission to reproduce the information in this publication for commercial purposes, please fill out the Application for Crown Copyright Clearance or contact the ISED Citizen Services Centre mentioned above.

Ⓒ Her Majesty the Queen in right of Canada, as represented by the Minister of Industry,

2020

 

Aussi 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).