Skip to content

Commit 41b030a

Browse files
committed
docs(sync): updated README for aw-sync with proper usage instructions
1 parent b87e32e commit 41b030a

File tree

1 file changed

+41
-13
lines changed

1 file changed

+41
-13
lines changed

aw-sync/README.md

+41-13
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,52 @@ aw-sync-rust
33

44
Synchronization for ActivityWatch.
55

6-
Works by syncing local buckets with a special folder, which in turn should be synchronized by rsync/Syncthing/Dropbox/GDrive/whatever.
6+
Works by syncing local buckets with a special folder, which in turn should be synchronized by rsync/Syncthing/Dropbox/GDrive/etc.
7+
8+
The latest beta versions of ActivityWatch ship with the `aw-sync` binary, but it's not enabled by default. You can start it from aw-qt or the command line, but due to the early state of development might not have the best UX. Please report issues and submit PRs!
79

810
Was originally prototyped as a PR to aw-server: https://github.com/ActivityWatch/aw-server/pull/50
911

1012

1113
## Usage
1214

13-
NOTE: Basic usage not quite ready yet, see the below testing sections for MVP usage.
15+
This will start a daemon which both pulls and pushes events with the sync directory.
1416

17+
```sh
18+
cargo run --bin aw-sync
1519
```
16-
cargo run --bin aw-sync -- sync
17-
```
1820

19-
## Running with real data on a testing instance
21+
For more options, see `cargo run --bin aw-sync -- --help`.
22+
23+
---
24+
25+
## FAQ
26+
27+
### When is it ready?
28+
29+
It works today, but there is still testing and polishing to be done before it's "click and play".
30+
31+
### Why do it this way?
32+
33+
By essentially only offering a "sync with folder" feature, we give the user a lot of freedom to choose how to store and sync their data.
34+
35+
We also avoid having to implement complex features such as conflict resolution, by enforcing that each device only writes to files in the sync folder they "own", and other devices may not modify them.
36+
37+
### What are the limitations?
38+
39+
- It only syncs afk and window buckets by default (since bucket IDs need to be unique)
40+
- It will work a lot better once proper `hostname -> device ID` migration is complete.
41+
- It doesn't sync settings
42+
- It doesn't support Android, yet.
43+
- It mirrors events to all devices,
44+
- If you have a lot of devices you'll get a lot of duplicates, taking up a lot of space and potentially impacting performance.
45+
- It doesn't support modifying/deleting events, yet.
46+
47+
---
48+
49+
## Advanced usage
50+
51+
### Syncing real data to a testing instance
2052

2153
If you want to try sync, you can do so by following these steps.
2254

@@ -46,14 +78,9 @@ We will use some helper scripts to do the following:
4678

4779
In the end, You should get something like this: https://twitter.com/ErikBjare/status/1519399784234246147
4880

81+
### Testing with fake data
4982

50-
## Testing with fake data
51-
52-
**Note:** this documents usage for testing, it is not yet ready for production usage.
53-
54-
It assumes you're running a temporary aw-server instances.
55-
56-
### Pushing to the sync directory
83+
#### Pushing to the sync directory
5784

5885
First start the sending aw-server instance. For example:
5986

@@ -66,7 +93,7 @@ You can create some test data by opening `http://localhost:5667/#/stopwatch` and
6693

6794
Then run `cargo run --bin aw-sync-rust -- --port 5667` to sync your instance's buckets with the target directory.
6895

69-
### Pulling from the sync directory
96+
#### Pulling from the sync directory
7097

7198
Now to sync things back from the sync directory into another instance.
7299

@@ -78,3 +105,4 @@ cargo run --bin aw-server -- --testing --port $PORT --dbpath test-$PORT.sqlite -
78105
```
79106

80107
Now run `cargo run --bin aw-sync-rust -- --port 5668` to pull buckets from the sync dir (retrieving events from the 5667 instance) and push buckets from the 5668 instance to the sync dir.
108+

0 commit comments

Comments
 (0)