aboutsummaryrefslogtreecommitdiff
path: root/README.md
blob: b58cbfa74088b3becdbc1459679547126932b9a5 (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
68
69
70
# usync

<img src="logo.png" width="120" markdown="1">

Sync any two paths with cloud backup.

## 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
just sync-cloud       # To cloud
just status           # Check
```

## Windows Setup (ext4 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)
```

## Structure

```
SOURCE/usync/         # Your files
TARGET/usync/         # Copy
cloud:/usync/         # Backup
```

## Commands

- `setup` - Create directories
- `check` - Verify paths
- `sync-paths` - Fast sync (unison)
- `sync-cloud` - Cloud backup (rclone)
- `status` - Show state

## Files

- `justfile` - Set SOURCE and TARGET paths
- `unison-profile.prf` - Sync settings