Smos Logo Smos

A comprehensive self-management system

Synchronisation

Documentation for the setting up synchronisation of your Smos workflow across devices

Synchronising Client

Your can synchronise your workflow directory using smos-sync-client. This synchronisation works with arbitrary amounts of time between synchronisations, so it is perfect for taking your laptop onto an airplane.

A community sync-server has been set up at api.smos.online.

Configuration

To get started, configure smos to use a sync server. You'll need to add the following to your smos config file:

sync:
  server-url: "api.smos.online"
  username: YOUR_USERNAME_HERE

Be sure to set the username that you want.

Registration

Then register your username at the sync server:

$ smos-sync-client register

You will be prompted for a password.

Password

If no password is configured, you will be prompted for a password. This is the most secure, but does not work well if you want to automate synchronisation.

You can also pass in a password using:

  • The --password option on the command line
  • The SMOS_SYNC_CLIENT_PASSWORD environment variable
  • The password field in your smos config file.

Synchronisation

To synchronise your workflow directory, run the following command:

$ smos-sync-client sync

Run this command periodically to keep your workflow directory synchronised.

Reference

Options

smos-sync-client sync [--workflow-dir DIRECTORY_PATH] [--contents-dir DIRECTORY_PATH] [--data-dir DIRECTORY_PATH] [--uuid-file FILE_PATH] [--metadata-db FILE_PATH] [--backup-dir FILE_PATH] [--ignore-nothing | --ignore-hidden-files] [--remove-empty-dirs | --keep-empty-dirs]

  --workflow-dir        The workflow directory                                                                         
  --contents-dir        The directory to synchronise                                                                   
  --data-dir            The directory to store state data in                                                           
  --uuid-file           The file to store the server uuid in                           default: "server-uuid.json"     
  --metadata-db         The file to store the synchronisation metadata database in     default: "sync-metadata.sqlite3"
  --backup-dir          The directory to store backups in when a sync conflict happens default: "conflict-backups"     
  --ignore-nothing      Do not ignore hidden files                                                                     
  --ignore-hidden-files Ignore hidden files                                                                            
  --remove-empty-dirs   Remove empty directories after syncing                                                         
  --keep-empty-dirs     Keep empty directories after syncing                                                           

Environment variables

  SMOS_WORKFLOW_DIR DIRECTORY_PATH               The workflow directory                                                                              
  SMOS_SYNC_CLIENT_CONTENTS_DIR DIRECTORY_PATH   The directory to synchronise                                                                        
  SMOS_SYNC_CLIENT_DATA_DIR DIRECTORY_PATH       The directory to store state data in                                                                
  SMOS_SYNC_CLIENT_UUID_FILE FILE_PATH           The file to store the server uuid in                             default: "server-uuid.json"        
  SMOS_SYNC_CLIENT_METADATA_DB FILE_PATH         The file to store the synchronisation metadata database in       default: "sync-metadata.sqlite3"   
  SMOS_SYNC_CLIENT_BACKUP_DIR FILE_PATH          The directory to store backups in when a sync conflict happens   default: "conflict-backups"        
  SMOS_SYNC_CLIENT_IGNORE_FILES IGNORE_FILES     Which files to ignore                                            examples: "no", "nothing", "hidden"
  SMOS_SYNC_CLIENT_EMPTY_DIRS EMPTY_DIR          What to do with empty directories after syncing                                                     

Configuration values

  The workflow directory
  workflow-dir:
    # or null
    <string>
  The directory to synchronise
  sync.contents-dir:
    # or null
    <string>
  The directory to store state data in
  sync.data-dir:
    # or null
    <string>
  The file to store the server uuid in
  default: "server-uuid.json"
  sync.uuid-file:
    # or null
    <string>
  The file to store the synchronisation metadata database in
  default: "sync-metadata.sqlite3"
  sync.metadata-db:
    # or null
    <string>
  The directory to store backups in when a sync conflict happens
  default: "conflict-backups"
  sync.backup-dir:
    # or null
    <string>
  Which files to ignore
  sync.ignore-files:
    # or null
    # nothing: Don't ignore any files
    # hidden: Ignore hidden files
    # one of
    [ nothing
    , hidden
    ]
  What to do with empty directories after syncing
  sync.empty-directories:
    # or null
    # remove: Remove empty directories after syncing
    # keep: Keep empty directories after syncing
    # one of
    [ remove
    , keep
    ]

Combined settings

Usage: smos-sync-client sync [--workflow-dir DIRECTORY_PATH] [--contents-dir DIRECTORY_PATH] [--data-dir DIRECTORY_PATH] [--uuid-file FILE_PATH] [--metadata-db FILE_PATH] [--backup-dir FILE_PATH] [--ignore-nothing | --ignore-hidden-files] [--remove-empty-dirs | --keep-empty-dirs]

Sync with a sync server

Available settings:
  Show this help text
  switch: -h|--help

  The workflow directory
  option: --workflow-dir DIRECTORY_PATH
  env: SMOS_WORKFLOW_DIR DIRECTORY_PATH
  config:
    workflow-dir: # or null
      <string>

  The directory to synchronise
  option: --contents-dir DIRECTORY_PATH
  env: SMOS_SYNC_CLIENT_CONTENTS_DIR DIRECTORY_PATH
  config:
    sync.contents-dir: # or null
      <string>

  The directory to store state data in
  option: --data-dir DIRECTORY_PATH
  env: SMOS_SYNC_CLIENT_DATA_DIR DIRECTORY_PATH
  config:
    sync.data-dir: # or null
      <string>

  The file to store the server uuid in
  option: --uuid-file FILE_PATH
  env: SMOS_SYNC_CLIENT_UUID_FILE FILE_PATH
  config:
    sync.uuid-file: # or null
      <string>
  default: "server-uuid.json"

  The file to store the synchronisation metadata database in
  option: --metadata-db FILE_PATH
  env: SMOS_SYNC_CLIENT_METADATA_DB FILE_PATH
  config:
    sync.metadata-db: # or null
      <string>
  default: "sync-metadata.sqlite3"

  The directory to store backups in when a sync conflict happens
  option: --backup-dir FILE_PATH
  env: SMOS_SYNC_CLIENT_BACKUP_DIR FILE_PATH
  config:
    sync.backup-dir: # or null
      <string>
  default: "conflict-backups"

  Do not ignore hidden files
  switch: --ignore-nothing

  Ignore hidden files
  switch: --ignore-hidden-files

  Which files to ignore
  env: SMOS_SYNC_CLIENT_IGNORE_FILES IGNORE_FILES
  examples: "no", "nothing", "hidden"
  config:
    sync.ignore-files: # or null
      # nothing: Don't ignore any files
      # hidden: Ignore hidden files
      # one of
      [ nothing
      , hidden
      ]
  default: IgnoreHiddenFiles

  Remove empty directories after syncing
  switch: --remove-empty-dirs

  Keep empty directories after syncing
  switch: --keep-empty-dirs

  What to do with empty directories after syncing
  env: SMOS_SYNC_CLIENT_EMPTY_DIRS EMPTY_DIR
  config:
    sync.empty-directories: # or null
      # remove: Remove empty directories after syncing
      # keep: Keep empty directories after syncing
      # one of
      [ remove
      , keep
      ]
  default: KeepEmptyDirs