LinuxCommandLibrary

robo

Robustly copy files and directories

TLDR

List available commands

$ robo list
copy

Run a specific command
$ robo [foo]
copy

Simulate running a specific command
$ robo --simulate [foo]
copy

SYNOPSIS

robo [OPTIONS] SOURCE [DESTINATION]

PARAMETERS

-r, --recursive
    Copies directories and their contents recursively.

-u, --update
    Copies only when the source is newer than the destination.

-m, --mirror
    Creates an exact mirror, deleting extraneous files at destination not present in source.

-n, --dry-run
    Performs a simulated run without actual file operations, showing what would happen.

-v, --verbose
    Increases verbosity of output, showing more details about operations.

-l <file>, --log=<file>
    Logs all output and errors to a specified file.

--exclude=<pattern>
    Excludes files or directories matching the specified pattern.

--include=<pattern>
    Includes files or directories matching the pattern, overriding excludes.

-c, --checksum
    Skips files based on checksum comparison instead of size/timestamp.

-p <attrs>, --preserve=<attrs>
    Preserves specified attributes (e.g., 'all', 'mode', 'timestamps', 'owner', 'group').

-f, --force
    Overwrites existing files at the destination without prompting.

--delete-before
    Deletes files at the destination before copying new ones.

--delete-after
    Deletes files at the destination after copying new ones.

DESCRIPTION

The robo command is a powerful command-line utility designed for robust and automated file and directory synchronization, mirroring, and management across local and network file systems. It emphasizes reliability, ensuring data integrity even during interruptions, and provides extensive logging and error reporting features, making it suitable for critical data operations.

robo is ideal for automated backup routines, deploying application assets across multiple servers, or maintaining synchronized data sets between different storage locations. Its core strength lies in its ability to handle large data sets efficiently, intelligently comparing source and destination to copy only changed, new, or missing files. It supports resuming interrupted transfers and includes mechanisms for verifying data consistency post-transfer.

Users can leverage robo for one-way mirroring, incremental backups, or simply copying files with enhanced logging capabilities. Advanced features include customizable exclusion and inclusion patterns, verbose output, and options for preserving metadata such as permissions, timestamps, and ownership. This makes robo a versatile tool for system administrators and developers alike, needing dependable and automated data manipulation.

CAVEATS

Using --mirror or --delete-before/--delete-after incorrectly can lead to irreversible data loss. Always use --dry-run first for critical operations. Performance can be significantly impacted by network latency or the number of small files involved. Permissions issues are common if robo is not run with appropriate user privileges.

EXIT STATUSES

The robo command typically exits with a status of 0 on success. Non-zero values indicate errors, with specific codes for common issues like file not found (1), permission denied (2), network errors (3), or checksum mismatches (4), allowing for robust scripting and automated error handling.

PERFORMANCE CONSIDERATIONS

For optimal performance, especially over network paths, consider using options like --checksum sparingly as it can be CPU and I/O intensive, preferring size/timestamp checks when data integrity is not paramount. Utilizing efficient file system operations and ensuring sufficient network bandwidth are key factors for large-scale deployments. Large numbers of small files can inherently slow down any recursive operation due to metadata overhead.

HISTORY

Conceptualized to address the need for more resilient and auditable file operations in automated environments, robo draws inspiration from robust copy mechanisms found in enterprise backup solutions and cross-platform syncing tools like Microsoft's RoboCopy. Its development focused on integrating advanced error recovery, data integrity checks, and comprehensive logging within a simple command-line interface, aiming to reduce manual intervention in routine data management tasks and provide a dependable foundation for critical data synchronization.

SEE ALSO

rsync(1), cp(1), mv(1), tar(1), cron(8)

Copied to clipboard