Your Peace of Mind is our Commitment

Contact Us English Recent Articles

SSH Tips & Tricks: How Does Checkpoint/Restart Feature Work?

First published: 30th September 2007

Do you need to transfer large files over an unreliable network link? Then here is a feature for you: Checkpoint/restart is a client-side feature that enables restarting a file transfer from the latest checkpoint instead of starting from the beginning. The feature is included in the SSH Tectia Client with EFT Expansion pack, and it works against servers that have the EFT or Tunneling Expansion Pack, as well as against SSH Tectia Server for IBM z/OS.

The feature works so that the client writes checkpoints to a local file.

The interval of the checkpoints can be configured both in seconds and in bytes. Default is 10 seconds and 10 MB. The checkpoints are enabled by setting the checksum option to 'checkpoint'. For example, the following would write checkpoints every 30 seconds and every 10 MB (default value):

$ scpg3 --checksum=checkpoint --checkpoint=s30 largefile user@server:/dest/directory/

The following sftpg3 command would write checkpoints every 60 seconds and every 100 MB:

sftp> get --checksum=checkpoint --checkpoint=s60 --checkpoint=b100000000 largefile

One thing to remember when using checkpoints is that the file contents are not inspected when resuming the file transfer. The checkpoint keeps track of the location in the file, it does not notice if the file is changed after the transfer was interrupted. If there are other users or processes that might have modified the file between the file transfer interruption and restart, you should not use checkpoints. In that case, checksum can be set to md5 or sha1 to find a safe point where to resume the file transfer, but this consumes considerably more processing power than the checkpoints. If you have a process that is polling for the file to do further processing with it, you might want to use the 'prefix' option that uses a temporary filename with a prefix and removes the prefix part only when the transfer is ready.