sshMaxArg module

This module determines the maximum possible length of an SSH command.

It can also can run as a stand alone script. The solution is based on https://www.theeggeadventure.com/wikimedia/index.php/Ssh_argument_length

sshMaxArg.probe_max_ssh_command_size(config, ssh_command_size=1048320, size_offset=1048320)[source]

Determine the maximum length of SSH commands for the current config

Try a SSH command with length ssh_command_size. The command is decreased by size_offset if it was too long or increased if it worked. The function calls itself recursively until it finds the maximum possible length. The offset size_offset is bisect in each try.

Parameters:
  • config (config.Config) – Back In Time config instance including the details about the current SSH snapshot profile. The current profile must use the SSH mode.

  • ssh_command_size (int) – Initial length used for the test argument.

  • size_offset (int) – Offset for increase or decrease ssh_command_size.

Returns:

The maximum possible SSH command length

Return type:

(int)

Raises:
  • Exception – If there are unhandled cases or the recurse ends in an undefined state.

  • OSError – If there are unhandled cases.

sshMaxArg.report_result(host, max_ssh_cmd_size)[source]
sshMaxArg.report_test(ssh_command_size, msg)[source]