blob: 8f928b3c0281f3eff9420310ba8f9d8f75907a4a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
# usync
<img src="logo.png" width="120" markdown="1">
Sync any two paths with each other & cloud backup.
Uses `unison` to sync the paths, rclone to sync to a cloud provider.
## Setup
```bash
git clone <repo> && cd usync
just install-deps
# Edit justfile: set SOURCE and TARGET paths
rclone config
just setup
```
## Use
```bash
just sync-paths # Between paths (SOURCE and TARGET in justfile)
just sync-cloud # To cloud
just status # Check
```
## Commands
- `setup` - Create directories
- `check` - Verify paths
- `sync-paths` - Fast sync (unison)
- `sync-cloud` - Cloud backup (rclone)
- `status` - Show state
## Windows (WSL) Setup for linux FS external drives
```bash
# 1. Identify drive (as Admin)
wmic diskdrive list brief
# Note: \\.\PHYSICALDRIVEN
# 2. Mount raw drive (as Admin)
wsl --mount \\.\PHYSICALDRIVE1 --bare
# Block device now visible in all WSL instances
# 3. In your WSL instance
sudo lsblk # Find /dev/sdxN
sudo mkdir /mnt/ext4drive
sudo mount /dev/sdd1 /mnt/ext4drive
sudo apt install rclone unison
# Edit justfile: SOURCE="/mnt/ext4drive", set TARGET & CLOUD_REMOTE
# 4. Run usync
just sync-cloud
# 5. Cleanup
sudo umount /mnt/ext4drive
wsl --unmount \\.\PHYSICALDRIVE1 # (as Admin)
```
## Configure
Edit justfile:
- SOURCE/TARGET - paths to sync
- CLOUD_REMOTE - rclone remote name
- CLOUD_PATH - cloud folder (default: /usync)
- CLOUD_MOUNT_PATH - local mount (default: ~/cloud-mount)
|