1. Overview
The RsyncSpaceCheckTask module provides RSYNC space estimation for BastionGuard Backup. It builds and monitors an RSYNC dry run to estimate the additional storage required for a snapshot without performing the final transfer.
The implementation is written in Vala and uses GLib/GIO together with the application utility namespaces required by the file.
2. Dependencies and Integration
The module imports:
TeeJee.LoggingTeeJee.FileSystemTeeJee.JsonHelperTeeJee.ProcessHelperTeeJee.SystemTeeJee.Misc
3. Declared Types
3.1 RsyncSpaceCheckTask
public class RsyncSpaceCheckTask : AsyncTask
This class encapsulates the state and operations described by this source file.
4. State, Properties, Constants, and Signals
Public and protected state
public bool delete_extra– Boolean state controlling or reporting delete extra.public bool delete_after– Boolean state controlling or reporting delete after.public bool delete_excluded– Boolean state controlling or reporting delete excluded.public bool relative– Boolean state controlling or reporting relative.public string exclude_from_file– Filesystem-related value used for exclude from file.public string link_from_path– Filesystem-related value used for link from path.public string source_path– Filesystem-related value used for source path.public string dest_path– Filesystem-related value used for dest path.public bool verbose– Boolean state controlling or reporting verbose.public bool io_nice– Boolean state controlling or reporting io nice.public bool dry_run– Boolean state controlling or reporting dry run.public int64 status_line_count– Counter associated with status line count.public int64 total_size– Size or capacity value associated with total size.
Internal state
private Regex sent_bytes_regex– Size or capacity value associated with sent bytes regex.
5. Public API and Operational Methods
5.1 RsyncSpaceCheckTask()
public RsyncSpaceCheckTask()
Initializes the object state, allocates required collections or widgets, and applies constructor parameters.
5.2 prepare()
public override void prepare()
Implements the prepare operation for this module.
5.3 build_script()
protected override string build_script()
Builds an RSYNC dry-run command configured to report transfer statistics without writing snapshot contents.
5.4 parse_stdout_line()
public override void parse_stdout_line(string out_line)
Parses stdout line and updates structured runtime data.
5.5 parse_stderr_line()
public override void parse_stderr_line(string err_line)
Parses stderr line and updates structured runtime data.
5.6 update_progress_parse_console_output()
public bool update_progress_parse_console_output (string line)
Implements the update progress parse console output operation for this module.
- Uses regular expressions to parse or validate text output.
6. Internal Helpers
6.1 init_regular_expressions()
private void init_regular_expressions()
Initializes regular expressions and prepares it for use.
7. External Commands and System Interfaces
The module constructs, checks, or parses commands containing:
rsync -aii
Execution success is determined from command exit status and, where applicable, parsed standard output or standard error.
8. Operational Flow
- Initialize object state, widgets, regular expressions, paths, or generated scripts.
- Transform raw values, command output, or metadata into structured or display-ready form.
9. Error Handling and Diagnostics
- GLib and filesystem exceptions are caught locally in the operations that can fail.
- The TeeJee logging layer records errors, debug state, generated commands, and operational messages.
10. Runtime and Security Considerations
- Output parsing: parsers depend on stable external-command or system-file formats and should be tested across distributions.
11. Licensing
The source is distributed under the GNU General Public License version 2 or any later version.
The source header identifies:
Copyright 2012-2018 Tony George <teejeetech@gmail.com>
