Skip to content

Syncing #35

Open
Open

Description

@ErikBjare

Vote on this issue on the forum!


There are two usage issues with ActivityWatch at the moment to which syncing is a solution:

  • If you use more than one device, you need to check every device individually, or run one centralized instance of aw-server (not recommended!)
  • If a machine is lost, so is the data (the user could have exported it, but data stored after the export would still be lost). While ActivityWatch cannot replace a proper backup system, syncing could help by storing copies of the data across devices.

I know of two interesting solutions to this problem:

  • Centralized server which stores all data encrypted (the server is unable to decrypt)
  • P2P synchronization (encrypted, possibly including relays)
    • Done by @syncthing very well, perhaps we could use it in some way. Also: MPL2 licensed and written in Go.
      • Downside: Clients must be online at the same time for sync.
      • They have the ability to set some folders to "read only", useful when you want to ensure the data stays intact in its source.
    • Implementing it ourselves would be an enormous effort, I assume.

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Activity

  1. ErikBjare commented on Mar 28, 2017

    @ErikBjare
    MemberAuthor

    @calmh might know a thing or two about using Syncthing in an application-specific context like this. I haven't seen it done before so we might want to check with him before we start.

    I've taken a look at the arguments to Syncthing and found -home which can be used to set a custom configuration directory. So pretty promising.

  2. ErikBjare commented on Mar 29, 2017

    @ErikBjare
    MemberAuthor

    I've started prototyping something small here: https://github.com/ActivityWatch/aw-syncthing/

    Could be made to work both with standalone Syncthing and bundled Syncthing, but standalone would probably be preferred due to the dependency on the Python package syncthing which targets a specific version (right now targets 0.14.24 and the latest is 0.14.25).

    What it does:

    • Moves the database file to a specific location
    • Creates a symlink from the new to the old location (so aw-server will just follow the symlink to the file)
    • Starts Syncthing with a custom configuration directory
    • Configures Syncthing via the REST API to add the new database folder as a synced folder
    • Add another device to sync the folder with
  3. calmh commented on Mar 29, 2017

    @calmh
  4. ErikBjare commented on Mar 29, 2017

    @ErikBjare
    MemberAuthor

    @calmh: Awesome! I'll let you know when we have a working release.

  5. ErikBjare commented on Jun 15, 2017

    @ErikBjare
    MemberAuthor

    I've started using Standard Notes recently (finally getting off Evernote) and have been impressed by the architecture. They have designed a neat data format/server called Standard File that defines how data should be encrypted and stored both client-side and server-side. Definitely something to check out.

    Edit: It's interesting, but I'd rather have it distributed than just decentralized.

  6. ErikBjare commented on Aug 24, 2017

    @ErikBjare
    MemberAuthor

    I've been thinking about this a bit more.

    My current idea is to simply configure a folder as a synced databases-folder. Basically aw-server would copy local data to this folder on a regular basis.

    This folder could then be synced with Syncthing, Dropbox, or Gdrive (we should probably explicitly recommend Syncthing). The synced database files would not be allowed to be modified from another host then the one who owns them, since such changes could cause syncing conflicts.

    Potential problems:

    • It would be nice to have the synced databases encrypted
    • Compressing them would also lead to huge storage savings
  7. ErikBjare commented on Sep 13, 2017

    @ErikBjare
    MemberAuthor

    Reddittracker turned up this today. Makes it pretty clear that sync is a vital feature for most users.

    The best part is that you can put it on all computers (home and work) and on a smartphone. It'll track the software and sites you use on all of them and aggregate it to one account.

  8. hippylover commented on Nov 21, 2017

    @hippylover

    Would be nice if this is implemented that it doesn't add to the system requirements to run the program. So for people who don't need the functionality or would rather just set up a cron job to copy it to a remote server manually can still disable the feature.

  9. ErikBjare commented on Nov 21, 2017

    @ErikBjare
    MemberAuthor

    @hippylover Noted! Thanks for the feedback.

  10. brizzbane commented on Jan 11, 2018

    @brizzbane

    I googled activitywatch + backup. Trying to locate where the data is stored. Would be really nice to be able to 'set' where the data is stored.

    Backup solution I use--is to put important stuff I'm working on under Dropbox or MEGA. I'm under linux...and I actually add a home directory, so that I ...guess it makes me more 'aware' that it's Dropbox data.

    I just read through the above comments--supposedly MEGA is end to end encrypted. I started using because more free data.. but it has the bonus of not having to mess with an encryption solution if you want to store it encrypted.

  11. 1000i100 commented on Apr 6, 2018

    @1000i100

    your sync look like auto-backup to me (or i've miss understoud)

    how do you merge activity from multiples devices ?

    if i was in charge, i probably use git as sync/merge tool if the data are stored in plain text files.
    But i've not explore your code base to make me an idea if it's a good way or not for this projet.

  12. 88 remaining items

  13. Terrance commented on Jul 8, 2024

    @Terrance

    Not sure if the same folks are watching all the AW repositories, but I've logged a sync-related issue ActivityWatch/aw-qt#105 where sync (along with the input watcher, another new module?) doesn't load at startup, unlike the other modules.

  14. I-Anonymouse-I commented on Aug 29, 2024

    @I-Anonymouse-I

    any progress or an official release day coming soon? i would also be happy with some sync option via dropbox or google drive, they have my data anyway as i am using windows and android, but i wanna hav it too.

  15. Guekka commented on Sep 2, 2024

    @Guekka

    any progress or an official release day coming soon? i would also be happy with some sync option via dropbox or google drive, they have my data anyway as i am using windows and android, but i wanna hav it too.

    I think 0.13.1 includes it?

  16. I-Anonymouse-I commented on Sep 2, 2024

    @I-Anonymouse-I

    well its not quite user friendly as there are no options or hints in the web ui and i dont think sync between android and windows is aldry functioning, is it?

  17. Hananel-Hazan commented on Sep 2, 2024

    @Hananel-Hazan

    Thank you for implementing this sync!

    Started to test aw-sync
    Does aw-sync can run with aw-server-rust or aw-server models?

    Also, when selecting the model from the icon in the tray menu
    image

    Its seems to run only with aw-server-rust , but I don't know where it save the data.

    However, where running from the command line aw-sync.exe --sync-dir "d:\dropbox\watchsync" it does save every 5min but the command line window need to be open as long as I wand it to sync...
    Is there a way to set it seamlessly like the aw-server(-rust) works?

    Another thing, when running the aw-sync from the command line with aw-server the two Buckets appear in http://localhost:5600/#/buckets. But I cant start aw-sync from the command line or the module menu. However, when switching to aw-server-rust and running aw-sync from the command line (activate it from the module menu sees top does nothing) those Buckets disappear, is this intentional.

  18. wahmedswl commented on Oct 11, 2024

    @wahmedswl

    Why https://litestream.io/ was never considered? It's good solution to sync sqlite database and cheap as well.

  19. aspiers commented on Oct 12, 2024

    @aspiers

    Dolt is another excellent open source decentralized replacement for MySQL, sqlite etc. Basically git for data. But it seems aw-sync is already quite far down a different path so I'm not sure if it's helpful to recommend different database backends at this point.

  20. axelkar commented on Jun 10, 2025

    @axelkar

    I recommend CRDTs and a P2P protocol. It's decentralized and if it's implemented correctly, there will never be sync issues other than being unconnected. I'll also want sync of things that are currently stored only in the web UI, like categorization. https://crdt.tech/

    any-sync (MIT-licensed) has worked brilliantly for Anytype (my note-taking app of choice), but it's probably unsuitable for ActivityWatch. The major feature is that it supports a central node

    Edit: super-productivity/super-productivity#4329 (comment)

  21. northkevin commented on Jun 25, 2025

    @northkevin

    I recommend CRDTs and a P2P protocol. It's decentralized and if it's implemented correctly, there will never be sync issues other than being unconnected. I'll also want sync of things that are currently stored only in the web UI, like categorization. https://crdt.tech/

    any-sync (MIT-licensed) has worked brilliantly for Anytype (my note-taking app of choice), but it's probably unsuitable for ActivityWatch. The major feature is that it supports a central node

    Edit: johannesjo/super-productivity#4329 (comment)

    Thanks, I just downloaded Anytype app this is so cool!

  22. jokester commented on Mar 3, 2026

    @jokester

    I have a poor man's centralized sync solution. In my case the full data is only required for retrospection, so I simply rsync the sqlite files to a central storage. No encryption but it can be implemented.

    push-db runs in every PC I use, under cron. Every a few weeks I pull-db the files to my main PC, and visualize the files with custom analytics code.

    #!/usr/bin/env bash
    set -ue
    REMOTE_DB_ROOT="STORAGE_HOST:activity-watch-sync"
    REMOTE_DB_DIR="$REMOTE_DB_ROOT/$HOSTNAME-$USER/"
    
    push-db () {
      # mac
      local LOCAL_DB_DIR1="$HOME/Library/Application Support/activitywatch/aw-server"
      # linux awather https://github.com/2e3s/awatcher
      local LOCAL_DB_DIR2="$HOME/.local/share/activitywatch/aw-server-rust"
      # maybe 
      local LOCAL_DB_DIR3="$HOME/.local/share/activitywatch/aw-server"
    
      if [[ -d "$LOCAL_DB_DIR1" ]]; then
        rsync --recursive --delete-after --verbose "$LOCAL_DB_DIR1" "$REMOTE_DB_DIR"
      elif [[ -d "$LOCAL_DB_DIR2" ]]; then
        rsync --recursive --delete-after --verbose "$LOCAL_DB_DIR2" "$REMOTE_DB_DIR"
      elif [[ -d "$LOCAL_DB_DIR3" ]]; then
        rsync --recursive --delete-after --verbose "$LOCAL_DB_DIR3" "$REMOTE_DB_DIR"
      fi
    }
    
    pull-db () {
      set -x
      rsync --recursive --verbose "$REMOTE_DB_ROOT" .
    }
    
    case "$1" in
      push-db)
        push-db
        ;;
      pull-db)
        pull-db
        ;;
      *)
        echo "invalid command"
        exit 1
        ;;
    esac
  23. TimeToBuildBob commented on Mar 11, 2026

    @TimeToBuildBob
  24. Hasan36arnob commented on Mar 30, 2026

    @Hasan36arnob

    got this from qwen

    # Linux
    ~/.local/share/activitywatch/aw-server-rust/
    
    # Windows  
    %APPDATA%\activitywatch\aw-server-rust\
    
    # macOS
    ~/Library/Application Support/activitywatch/aw-server-rust/
  25. lunchfang commented on Apr 12, 2026

    @lunchfang

    👋 Hi there!

    I'm interested in working on this task. Before I start, I'd like to confirm a few details:

    1. Bounty Amount: Is the bounty still TBD?
    2. Acceptance Criteria: What exactly needs to be delivered? Any specific requirements?
    3. Timeline: Any deadline or preferred completion time?
    4. Testing: Are there specific test cases or environments I should use?
    5. Payment: What's the preferred payment method once completed?

    Please confirm and I'll get started right away! 🚀


    Automated message from Atlas Bounty Hunter

  26. millette commented on Jul 23, 2026

    @millette
  27. removed
    bountyAn issue or PR with a bounty for solving
    on Nov 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions