Update Scripts/Powershell/rClone.md

This commit is contained in:
2024-12-05 00:51:45 -07:00
parent 38af91e84f
commit 5766aaeff7

View File

@ -7,16 +7,22 @@ Rclone is a command-line program to manage files on cloud storage. It is a featu
There is a lot to keep in mind when using rclone, primarily with the `sync` command. You can find more information in the [Official Documentation](https://rclone.org/commands/)
## rClone `bisync` Implementation
Perform bidirectional synchronization between two paths. Bisync provides a bidirectional cloud sync solution in rclone. It retains the `locationA` and `locationB` filesystem listings from the prior run. On each successive run it will:
- List files on `locationA` and `locationB`, and check for changes on each side. Changes include `New`, `Newer`, `Older`, and `Deleted files`.
- Propagate changes on Path1 to Path2, and vice-versa.
Perform bi-directional synchronization between two locations (e.g. `Local` and `Remote`). Bisync provides a bi-directional cloud sync solution in rclone. It retains the file structure and history data in both the `Local` and `Remote` locations from the first time you run bisync.
### Example Usage
The following commands illustrate how to use bisync to synchronize a local folder and a remote folder (assumed to be Google Drive). The `--drive-skip-gdocs` flag simply does not sync Google Drive specific documents back to the local folder, such as `*.gsheet`, `*.gdoc`, etc. The `--resilient` flag means that if there are network interruptions, rclone will attempt to recover on its own automatically to resume where it last left off in the sync.
The following commands illustrate how to use bisync to synchronize a local folder and a remote folder (assumed to be Google Drive).
!!! example "Explanation of Command Arguments"
- `--drive-skip-gdocs`: This prevents the sync from syncing Google Drive specific documents such as `*.gsheet`, `*.gdoc`, etc.
- `--resilient`: This means that if there are network interruptions, rclone will attempt to recover on its own automatically.
- `--conflict-resolve newer`: This is how the bisync determines how to declare a "*winner*" and a "*loser*".
- The winner being the newer file, and the loser being the older file.
- `--conflict-loser delete`: This is the action to perform to the older file when a conflict is found in either direction.
- `--update`: This skips files that are newer on the destination, allowing us to ensure that the newest changes on the remote storage are pulled down before performing our first bisync.
=== "Initial Sync"
We want to first sync down any files that are from the remote location (Google Drive/Remote Folder/Network Share/etc) and overwrite any local files with the newer files. This ONLY overwrites local files that are older than the remote files, but if the local files are newer, they are left alone. `--update` = (Skip files that are newer on the destination) > This allows us to ensure that the newest changes on Google Drive are pulled down before performing a bisync.
We want to first sync down any files that are from the remote location (Google Drive/Remote Folder/Network Share/etc) and overwrite any local files with the newer files. This ONLY overwrites local files that are older than the remote files, but if the local files are newer, they are left alone.
```powershell
.\rclone.exe sync "Remote" "Local" --update --log-level INFO --drive-skip-gdocs --create-empty-src-dirs --progress
@ -28,7 +34,4 @@ The following commands illustrate how to use bisync to synchronize a local folde
- If the local file was newer, it deletes the older remote file and overwrites it with the newer local file
```powershell
.\rclone.exe bisync "Local" "Remote" --create-empty-src-dirs --conflict-resolve newer --conflict-loser delete --compare size,modtime,checksum --resilient --log-level ERROR --drive-skip-gdocs --fix-case --force --progress
```
!!! info
The `--conflict-resolve newer` flag is how the bisync determines how to declare a "winner" and a "loser", the winner being the newer file, and the loser being the older file. The `--conflict-loser delete` is the action to perform to the older file when a conflict is found in either direction.
```