Overview
`rsync-progress` is not an independent command, but rather a general term for the feature that shows transfer progress through the `--progress` option of `rsync`, a powerful file synchronization tool. Using this feature allows you to check the current status in real-time during file transfers, which is useful when synchronizing large files or multiple files.
Key Features
The key information you can obtain through `rsync`'s `--progress` option includes:
- Real-time transfer progress (percentage)
- Name of the file currently being transferred
- Transfer speed (e.g., MB/s)
- Estimated time remaining
Key Options
`rsync-progress` utilizes the options of the `rsync` command. Here are some commonly used `rsync` options along with progress display:
Progress and Output
Synchronization Behavior
Generated command:
Try combining the commands.
Description:
`rsync-progress` Executes the command.
Combine the above options to virtually execute commands with AI.
Installation
`rsync-progress` is not a separate command that requires installation; it is a feature of the `rsync` command. `rsync` is pre-installed on most Linux distributions, but if it is not, you can install it using the following commands:
Debian/Ubuntu
sudo apt update && sudo apt install rsync
Install `rsync` using the APT package manager.
CentOS/RHEL
sudo yum install rsync
Install `rsync` using the YUM package manager.
Fedora
sudo dnf install rsync
Install `rsync` using the DNF package manager.
Usage Examples
Here are various examples of using the `rsync` command with the `--progress` option to monitor file synchronization progress:
Synchronize Local Directory and Show Progress
rsync -avh --progress source_dir/ destination_dir/
Synchronizes the contents of `source_dir` in the current directory to `destination_dir` while displaying the progress.
Synchronize Files to a Remote Server and Show Progress
rsync -avz --progress local_files/ user@remote_host:/path/to/remote_dir/
Synchronizes the local `local_files/` directory to `user@remote_host:/path/to/remote_dir/` on a remote server, displaying the progress.
Create an Alias for `rsync-progress`
alias rsync-progress='rsync -avh --progress'
You can create an alias named `rsync-progress` that includes frequently used `rsync` options for convenient use. This alias is only valid for the current shell session; to use it permanently, add it to your shell configuration file (e.g., `~/.bashrc`, `~/.zshrc`).
Synchronize Locally Using the Alias
rsync-progress /path/to/source/ /path/to/destination/
Synchronizes local directories using the `rsync-progress` alias created above.
Simulate Deletion and Show Progress
rsync -avh --progress --delete --dry-run source_dir/ destination_dir/
Checks which files would be deleted if the `--delete` option were applied, using `--dry-run` without actually deleting files.
Tips & Precautions
Here are some useful tips and points to be aware of when using `rsync` with the `--progress` option.
Efficient Option Combinations
Using `--progress` with `-v` (verbose) provides more information, and with `-h` (human-readable), you can easily grasp file sizes. `-a` (archive) is recommended for most synchronization tasks.
- `rsync -avh --progress source/ dest/` (Most common and useful combination)
- `rsync -avz --progress source/ user@host:dest/` (Add compression for remote transfers)
Utilizing `--dry-run`
Especially when using destructive options like `--delete`, it is always recommended to first use the `--dry-run` option to preview what changes will occur. This is crucial for preventing unexpected data loss.
Consider Network Environment
When transferring to a remote server, the `--compress` (`-z`) option can save network bandwidth but increases CPU usage. If the network speed is sufficiently fast, compression might actually increase transfer time, so it should be used appropriately depending on the environment.
Caution with Source/Destination Path Slashes (`/`)
A trailing slash on the source path (`source_dir/`) means the *contents* of `source_dir` will be copied to the destination. Without a slash (`source_dir`), `source_dir` *itself* will be created inside the destination directory. This difference is very important, so pay attention.