Issues / Rationale
The cloud sync feature of TrueNAS is underpinned by Rclone to enable cross-storage data synchronization (e.g., between local storage and S3-compliant object storage). However, it currently only supports extension via pre-scripts/post-scripts and lacks a native configuration entry for customizing advanced Rclone parameters. This creates critical pain points for users in complex synchronization scenarios (such as S3 protocol compatibility, special permission handling, error avoidance, and refined log configuration), including the following:
- Inability to precisely resolve protocol compatibility issues: For example, the âincompatible remotesâ error that occurs when syncing between S3 and local storage requires disabling implicit operations using native Rclone parameters like and . Yet the existing script functionality cannot directly embed these parameters into the core sync process, leading to recurrent errors.
--no-move--ignore-errors - Inefficient logging and debugging: Troubleshooting sync errors requires manual modification of scripts or configuration files to add parameters such as and . This process is cumbersome, error-prone, and cannot be configured quickly via the graphical user interface (GUI).
--log-level=DEBUG--log-format - Unmet requirements for special scenarios: Needs such as skipping symbolic links during sync (), preserving file metadata (), and limiting transfer rates () cannot be fulfilled. The existing pre-/post-scripts only execute independent commands and cannot intervene in the core logic of Rclone synchronization.
--skip-links--preserve-modtime--bwlimit - Limitations of the script functionality: Pre-/post-scripts are designed for auxiliary operations before and after synchronization (e.g., directory creation, cache cleanup), rather than parameter injection during the sync process. They cannot replace the direct control of sync behavior enabled by advanced Rclone parameters.
Impacts
1. Core Benefits and Advantages
- For users in complex scenarios (e.g., S3 sync users): Deliver flexible parameter configuration capabilities, allowing protocol compatibility, error avoidance, and log debugging to be resolved directly via the GUIâwithout reliance on the command line or scripts, lowering technical barriers.
- For regular users: No disruption to existing usage habits; the original sync logic is retained by default, with only an optional Advanced Parameters configuration item added for on-demand enablement.
- For the TrueNAS product ecosystem: Enhance the flexibility and compatibility of the cloud sync feature to adapt to the special requirements of more storage protocols (e.g., S3, WebDAV, FTP), improving the productâs practicality in enterprise-level scenarios.
- Efficiency gains: Reduce script writing and configuration file modifications required for user parameter configuration, and shorten troubleshooting cycles (e.g., obtaining detailed logs quickly via ).
--log-level
2. Potential Disadvantages and Mitigation Solutions
- Risk of parameter misuse: Certain Rclone parameters (e.g., ) may pose data risks. Mitigate this by adding links to parameter documentation and risk prompt popups in the interface, and advising users to configure parameters with reference to the official Rclone documentation.
--delete-all - Increased interface complexity: New configuration items may confuse novice users. Resolve this by placing the Advanced Parameters in a collapsible Advanced Options panel, hidden by default to avoid interfering with basic user operations.
- Compatibility maintenance costs: Rclone parameters iterate rapidly, requiring the TrueNAS team to adapt to new parameters regularly. However, core parameters (e.g., those for logging, error handling, and transfer control) have high stability, making maintenance costs manageable.
User Stories
Scenario 1: Resolve the âincompatible remotesâ Error in S3 Sync
User Role: TrueNAS administrator who needs to sync a local directory to S3-compliant object storage.User Goal: Avoid the âcanât move object - incompatible remotesâ error by disabling Rcloneâs implicit move operation.Steps:
- Log in to the TrueNAS Web UI and navigate to Cloud Sync â Create/Edit Sync Task.
- After completing basic configurations (source/target paths, selecting Copy as the operation type), expand the Advanced Options panel.
- Locate the Rclone Advanced Parameters input box and enter the parameters: .
--no-move --ignore-errors --log-level=DEBUG - Save the task and trigger synchronization manually; the system automatically passes the parameters to the core Rclone command.
- After synchronization is complete, verify that the error is resolved via logs and confirm that files are copied to S3 successfully.
Scenario 2: Configure Refined Sync Logs
User Role: TrueNAS user who needs to troubleshoot I/O errors during synchronization.User Goal: Obtain detailed logs with millisecond-level timestamps to locate problematic files.Steps:
- Navigate to Advanced Options â Rclone Advanced Parameters for the sync task.
- Enter log-related parameters: .
--log-file=/var/log/rclone/s3_sync.log --log-format=date,time,millis,level,msg --log-level=DEBUG - After running the sync task, execute in the TrueNAS terminal to view real-time detailed logs with precise timestamps.
tail -f /var/log/rclone/s3_sync.log - Adjust permissions or path configurations targetedly based on error information in the logs (e.g., I/O errors for specific files).
Scenario 3: Limit Sync Transfer Rates
User Role: Enterprise user who needs to sync large files during working hours without occupying excessive bandwidth.User Goal: Limit the maximum transfer rate of Rclone synchronization to avoid impacting other business operations.Steps:
- Edit the cloud sync task and enter the parameter in Rclone Advanced Parameters: (limit to 10MB/s).
--bwlimit=10M - Save the configuration and start synchronization; the system automatically transfers files at the configured rate.
- Monitor the transfer status via the task progress bar during synchronization and confirm that bandwidth usage meets expectations.