Keep folders syncing

Keep every synced folder on your computer in step with one watch that starts when you log in.

A folder you set up stays in step only while something watches it. One watch keeps every folder on the computer in step, and autostart runs it each time you log in, so no terminal stays open.

Start the watch when you log in

Turn on autostart once on each computer:

marfa folders autostart on

It starts the watch at once, in your own account, and again each time you log in: a launchd agent on macOS, a systemd user unit on Linux. It runs at a lower priority than your apps, and uses the sign-in that marfa login keeps in your keychain. Where the keychain stays locked, such as on a server, give the watch a key file, as Give a key to a folder watch shows.

marfa folders autostart status says whether the watch is running, and why any folder isn't watched, such as one whose first sync waits for you. When you update the CLI, the watch moves to the new build by itself.

Watch by hand

To run the watch in a terminal instead, start it with no directory, and it watches every folder that marfa folders list shows:

Terminal
marfa folders watch
watching every folder /Users/sam/Library/Application Support/Marfa/folders.json lists (interrupt to stop)
/Users/sam/Documents/Home: watching
/Users/sam/Documents/Home: 0 created, 1 updated, 0 renamed, 0 deleted; the server answered 1 change(s); 1 file(s) written

Press Control+C to stop it. Don't run one by hand while autostart is on: one process works a folder at a time.

What the watch does

  • It sends an edit within seconds, and writes in what changed elsewhere, and it follows the list of folders, so a folder you add or remove needs no restart.
  • When your instance can't be reached or asks it to wait, it keeps your edits and sends them later.

A folder holds a large addition or removal until you say, and the rest of the folder goes on syncing: see Fix a folder. To stop syncing for a while, see Change or stop syncing a folder. If edits stop arriving, Fix a folder says where to look.

On this page