A collection of PowerShell scripts and utilities to help monitor and manage RClone synchronization operations with automated email reporting.
This project provides a solution for running RClone bisync operations and monitoring their results through email notifications. The scripts handle synchronization, logging, error detection, and automated reporting to keep you informed of your backup status.
- Automated Bisync Operations: Configurable sync tasks for multiple directories
- Email Log Monitoring: Daily email summaries with HTML formatting
- Error Detection: Automatic detection and highlighting of errors in logs
- Log Archiving: Automatic compression and archiving of log files
- Web Dashboard: Optional web interface for RClone management
- Customizable Filtering: Exclude specific files and folders from sync
rCloneMRunner.ps1– Main script for running regular bisync operations (Run once as Admin to set up event trigger)rCloneMRunner_Resync.ps1– Script for running bisync with--resyncflag (initial sync or recovery)SendRcloneLogs.ps1– Email notification script that processes and sends log summariesrcloneStartupDashboard.cmd– Batch file to start RClone web dashboard (optional)
filters/rCloneDesktopFilter.txt– Filter file to exclude specific file types from synclogs/– Directory for storing log files and archived logs
- RClone installed and configured with your cloud storage provider
- PowerShell 5.1 or later
- Windows Credential Manager for storing email credentials
- SMTP access for email notifications (Gmail example provided)
- Clone or download this repository to your desired location
- Update the configuration variables in each script (see Configuration section)
- Set up your email credentials in Windows Credential Manager
- Configure RClone with your cloud storage provider
- Run the main runner script (
rCloneMRunner.ps1) as Administrator once to set up the event that triggers the email sender - Test the scripts individually before scheduling
Note: You can use any email provider as long as they have a SMTP service that you can use
In rCloneMRunner.ps1 and rCloneMRunner_Resync.ps1:
$rcloneExe = "C:\rclone\rclone.exe"
$logDir = "C:\rclone\logs"
$syncTasks = @(
@{
Remote = "remote:YourBucket"
Local = "C:\Users\YourUser"
LogFile = Join-Path $logDir "bisync_Pictures_files.txt"
ExtraArgs = @("--create-empty-src-dirs")
}
# Add more sync tasks as needed
)In SendRcloneLogs.ps1:
$LogDirectory = "C:\rclone\logs"
$smtpServer = "smtp.gmail.com"
$smtpUsername = "your-email@gmail.com"
$fromAddress = "your-email@gmail.com"
$toAddress = "your-email@gmail.com"In rcloneStartupDashboard.cmd (optional):
C:\rclone\rclone.exe rcd --rc-web-gui --rc-serve --rc-user your-username --rc-pass your-password --rc-web-gui-update --rc-web-gui-no-open-browserStore your email credentials securely using Windows Credential Manager:
cmdkey /add:"GmailSMTP" /user:"yourgmail@gmail.com" /pass:"your-app-password"Or via GUI:
- Control Panel → Credential Manager → Windows Credentials → Add a Generic Credential
- Target: GmailSMTP
- Username: your-email@gmail.com
- Password: your-app-password
Note: Gmail requires an App Password instead of your regular password: https://support.google.com/accounts/answer/185833?hl=en
# Regular sync
.\scripts\rCloneMRunner.ps1
# Resync (for initial sync or recovery)
.\scripts\rCloneMRunner_Resync.ps1
# Send log summary email
.\scripts\SendRcloneLogs.ps1
# Start web dashboard (optional)
.\scripts\rcloneStartupDashboard.cmdDepending on where your rclone exe is located as well as your scripts you may want to check the "Run with highest privileges" button.
You may also want to check the "Run whether user is logged on or not" for each task depending of prefrence.
-
Open Task Scheduler
-
Click Create Task
-
Name it:
RClone Main Runner -
Trigger: Daily, set time (e.g., 6:00 PM)
-
Action: Start a program
-
Program/script:
powershell.exe -
Add arguments:
-NoProfile -ExecutionPolicy RemoteSigned -File "C:\rclone\scripts\rCloneMRunner.ps1"
-
-
Click Finish
Under Conditions, uncheck "Start task only if the computer is on AC power" if on a laptop. Under Settings, you may want to check "Run task as soon as possible after a scheduled start is missed"
In Task Scheduler, click Create Task
Go to Triggers → New…
Begin the task: On an event
Set up like this:
Log: Application
Source: RClone
Event ID: 1001
In Actions, add:
Program: powershell.exe
Arguments:
-NoProfile -ExecutionPolicy RemoteSigned -File "C:\rclone\scripts\SendRcloneLogs.ps1" (>> "C:\rclone\logs\MailLog.txt" 2>&1 (optional for login the script - remove this text and brackets to use))
Under Conditions, uncheck "Start task only if the computer is on AC power" if on a laptop.
Under Settings, you may want to check "Run task as soon as possible after a scheduled start is missed"
The email notification system provides:
- ✅ HTML summaries with green/red highlights
- ❌ Error detection (e.g. failed, denied, fatal)
- 📎 ZIP attachments of raw logs
- 🧹 Archived logs to prevent disk bloat
- 🔍 Filtered output (removes clutter like "bisync is in BETA")
In rCloneMRunner.ps1 and rCloneMRunner_Resync.ps1:
@{
Remote = "remote:Bucket/NewFolder"
Local = "C:\Users\You\NewFolder"
LogFile = Join-Path $logDir "bisync_NewFolder_files.txt"
ExtraArgs = @("--create-empty-src-dirs", "--exclude", "*.tmp")
}Edit filters/rCloneDesktopFilter.txt to exclude undesired files. Example excludes .url and .lnk files.
Update SendRcloneLogs.ps1:
$ErrorKeywords = "error|fail|denied|fatal|critical|warning"- ✉️ Email not sending: Check SMTP server, credentials, or firewall
- 🔗 Sync issues: Confirm RClone paths and credentials
- 🔒 Access denied: Run PowerShell as Admin once
- 📂 No logs: Ensure correct directory and file naming
- Use Windows Credential Manager for secure credential storage but keep in mind that this will not keep your app passowrd or similar safe if someone on your machine really wants it, but is better than pasting it on a random script you found online.
- Avoid syncing private system or game files as they may contain large amounts of data that could increase costs (filter wisely)
Feedback, issues, or PRs welcome! Help make the scripts better for others.
Open for personal/educational use. Modify and redistribute as needed — no warranty included.
Reminder: Test thoroughly before production use. Maintain backups at all times.