mirror of
https://github.com/bigbeartechworld/big-bear-scripts.git
synced 2026-03-31 06:33:56 -04:00
* ✨ feat: Add interactive rsync script This commit introduces a new interactive rsync script that allows users to visually select specific files and directories for synchronization. The script provides the following features: - Interactive file/directory selection - Color-coded interface for better visibility - Multiple file selection support - Progress indication during transfer - Automatic destination directory creation - Input validation and error handling The script is designed to simplify the rsync process by eliminating the need for complex command-line arguments, making it more user-friendly and accessible for a wider audience. * ✨ feat: Add file size display and transfer confirmation This commit adds the following improvements to the interactive-rsync script: - Displays the file/directory size next to each item in the selection menu. - Adds a confirmation prompt before starting the transfer to ensure the user is ready. - Allows the user to specify file patterns to exclude from the transfer. - Displays a summary of the successful and failed transfers at the end of the process. These changes enhance the user experience by providing more information and control over the file transfer process.
Big Bear Interactive Rsync
Why?
This script provides an interactive way to select specific files and directories for rsync operations. Instead of syncing entire directories or writing complex rsync commands, you can visually select which items you want to sync.
Features
- Interactive file/directory selection with size information
- Color-coded interface for better visibility
- Multiple file selection support
- File/directory size display
- Pattern-based file exclusion (e.g., _.tmp, _.log)
- Transfer confirmation and progress tracking
- Detailed transfer summary with success/failure reporting
- Automatic destination directory creation
- Input validation and error handling
How to use?
- Make the script executable:
chmod +x run.sh
- Run the script (optionally with a source directory):
./run.sh # Uses current directory as source
./run.sh /path/to/directory # Uses specified directory as source
- Follow the interactive prompts:
- Enter file patterns to exclude (optional)
- Select items by entering their numbers (space-separated)
- Type 'a' to select all items
- Type 'q' to quit
- Enter the destination path
- Confirm the transfer
Example
./run.sh ~/Documents
Example session:
1) document.pdf (1.2M)
2) images (2.3G)
3) notes.txt (45K)
Enter file patterns to exclude: *.tmp *.log
Enter numbers to select: 1 3
Selected items: 2
- document.pdf (1.2M)
- notes.txt (45K)
Enter destination: ~/backup
Start transfer? (y/n): y
Transfer Summary:
Successfully transferred: 2/2
Requirements
- Bash shell
- rsync installed on your system
One-line Installation
bash -c "$(wget -qLO - https://raw.githubusercontent.com/bigbeartechworld/big-bear-scripts/master/interactive-rsync/run.sh)"