aboutsummaryrefslogtreecommitdiff
path: root/README.md
blob: 555c88c567b0d883996947c3476e750cda2b3876 (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
71
72
73
# 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
rclone config
# Edit justfile: set SOURCE, TARGET, and CLOUD_REMOTE variables
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) with usbipd-win

```bash
# 1. Install usbipd-win (Admin PowerShell)
# Download from https://github.com/dorssel/usbipd-win/releases/latest

# 2. List devices
usbipd list
# Note BUSID (e.g., 1-20)

# 3. Attach (Admin PowerShell)
usbipd bind --busid 1-20
usbipd attach --wsl --busid 1-20
wsl  # Start admin WSL

# 4. In admin WSL
sudo mkdir /mnt/drive1
sudo mount /dev/sdb1 /mnt/drive1     # Replace sdb1

# 5. Configure & run
# Edit justfile: SOURCE="/mnt/drive1"
just sync-cloud

# Cleanup (optional)
sudo umount /mnt/drive1
# sudo umount /mnt/drive2  # If using second drive

# Detach & unbind (required before removing drive)
usbipd detach --busid 1-20
usbipd unbind --busid 1-20
```

## Configure

Edit justfile:
- SOURCE/TARGET - paths to sync (e.g. /mnt/drive1)
- CLOUD_REMOTE - rclone remote name (e.g. cloud_remote:)
- CLOUD_PATH - cloud folder (default: /usync)
- CLOUD_MOUNT_PATH - local mount (e.g. /home/user/cloud-mount)