Cloud Sync
Cloud storage synchronization tool for automated backup distribution and management across multiple cloud providers.
Cloud Sync Tool
A powerful cloud synchronization tool that manages backup distribution and storage across multiple cloud providers with automated scheduling and monitoring.
Features
Cloud Provider Support
- Amazon S3
- Google Cloud Storage
- Microsoft Azure Blob Storage
- Backblaze B2
- Custom S3-compatible storage
Synchronization
- Automated sync scheduling
- Incremental updates
- Delta synchronization
- Multi-region support
- Bandwidth optimization
Management
- Storage lifecycle management
- Cost optimization
- Access control
- Encryption management
- Version control
Installation
Prerequisites
- Bash shell
- Python 3 (for cloud SDKs)
- jq (for JSON processing)
- yq (for YAML processing)
Installation Steps
Download the script from the Lambda Softworks Customer Portal:
- Log in to your Lambda Softworks Customer Portal account
- Navigate to the Files section
- Download the cloud-sync.sh script
Make the script executable:
chmod +x cloud-sync.sh
- Install dependencies:
# For Debian/Ubuntu sudo apt-get update sudo apt-get install -y python3 jq yq # For RHEL/CentOS sudo yum install -y python3 jq yq
Usage
Basic Commands
- Configure cloud provider:
./cloud-sync.sh --configure aws
- Sync backup:
./cloud-sync.sh --sync /path/to/backup
- List cloud storage:
./cloud-sync.sh --list
Command-Line Options
--configure PROVIDER
: Configure cloud provider--sync PATH
: Sync backup to cloud--list
: List cloud storage contents--schedule CRON
: Schedule sync operations--setup PROVIDER
: Set up cloud provider (installs required CLIs)--sync-now PATH
: Perform immediate sync--test-connection PROVIDER
: Test provider connection--storage-type TYPE
: Cloud storage type (s3, blob)--region REGION
: Cloud region--container CONTAINER
: Cloud container name--sas-token TOKEN
: Azure SAS token--account-name NAME
: Cloud account name--account-key KEY
: Cloud account key--endpoint URL
: Custom endpoint URL--nfs-server SERVER
: NFS server address--nfs-share SHARE
: NFS share path--exclude PATTERN
: Exclude pattern--include PATTERN
: Include pattern--delete
: Delete remote files not present locally--dry-run
: Test without making changes--progress
: Show progress during sync--config FILE
: Custom configuration file--help
: Show help message
Automatic CLI Installation
The script automatically installs required cloud provider CLIs if they are not present:
- AWS CLI: Installed via package manager (apt-get, yum, dnf) or Homebrew
- Azure CLI: Installed via package manager with Microsoft repository
- azcopy: Installed automatically for Azure Blob Storage support
Configuration
Configuration Directory
Location: $HOME/.cloud-sync/
Provider Configuration Files
- AWS:
$HOME/.cloud-sync/aws-config
- GCP:
$HOME/.cloud-sync/gcp-config
- Azure:
$HOME/.cloud-sync/azure-config
Cloud Provider Settings
# Example cloud-config.yml providers: aws: region: "us-west-2" bucket: "my-backup-bucket" prefix: "daily/" encryption: true lifecycle: days: 30 storage_class: "STANDARD_IA" gcp: bucket: "my-backup-bucket" location: "us-central1" encryption: true
Logs and Data Storage
Log Files
- Main log:
$HOME/.cloud-sync.log
- Reports:
$HOME/.cloud-sync-reports/
- SMTP config:
$HOME/.backup-smtp.conf
Installation Directory
- Script location:
/usr/local/bin
System Support
Supported Operating Systems
- macOS (via Homebrew)
- Debian/Ubuntu (via apt-get)
- RHEL/CentOS (via yum)
- DNF-based systems (via dnf)
Examples
Configure and Sync
# Configure AWS provider ./cloud-sync.sh --configure aws # Sync backup to cloud ./cloud-sync.sh --sync /backup/daily_20240101.tar.gz # Schedule daily sync ./cloud-sync.sh --schedule "0 3 * * *"
Manage Cloud Storage
# List cloud contents ./cloud-sync.sh --list # View sync logs tail -f /var/log/lambdasoftworks/sync/aws.log
Troubleshooting
Common Issues
Authentication Issues
- Verify credentials
- Check access permissions
- Review IAM roles
- Validate API keys
Sync Failures
- Check network connectivity
- Verify file permissions
- Review bandwidth limits
- Check storage quotas
Storage Issues
- Monitor storage costs
- Check bucket policies
- Review lifecycle rules
- Validate encryption
Debug Mode
To enable debug logging:
DEBUG=1 ./cloud-sync.sh [OPTIONS]