Syncing photos to an S3 bucket using Rclone.
- Rclone installed and configured with your S3 bucket
- Bash (for Unix) or PowerShell (for Windows)
- Appropriate permissions to access the source directory and create/modify files in the script directory
-
Choose the appropriate script based on your operating system:
photo_sync.shfor Unix (Linux, macOS)photo_sync.ps1for Windows
-
Edit the script to set the correct values for:
SOURCE_DIR: The directory containing your photosS3_BUCKET: Your rclone remote configuration and S3 bucket path
-
Ensure the script has executable permissions (for Unix):
chmod +x photo_sync.sh
Both scripts support the following commands:
start: Begin the sync processstop: Stop the running sync processrestart: Restart the sync processstatus: Check if a sync process is currently running
./photo_sync.sh {start|stop|restart|status}.\photo_sync.ps1 {start|stop|restart|status}Key features:
- Uses Rclone to sync photos to an S3 bucket
- Manages the sync process with start, stop, restart, and status functions
- Logs sync activities
- Handles graceful termination and force killing if necessary
This script is designed for Windows systems. It uses PowerShell to manage the sync process.
Key features:
- Uses Rclone to sync photos to an S3 bucket
- Manages the sync process with start, stop, restart, and status functions
- Logs sync activities
- Handles graceful termination and force killing if necessary
You can customise the following variables in both scripts:
SOURCE_DIR: Set this to the directory containing your photosS3_BUCKET: Set this to your rclone remote configuration and S3 bucket path- Adjust rclone parameters in the
start_syncfunction to fine-tune the sync process
- If the sync doesn't start, check the log file (
photo_sync.log) for error messages - Ensure rclone is properly configured with your S3 bucket
- Verify that the source directory exists and is accessible
- Check that you have the necessary IAM permissions to run the script and access the required S3 bucket