Help us shape the future of Go! Take the 2026 Go Developer Survey

scripts

command
v0.3.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 28, 2026 License: MIT Imports: 8 Imported by: 0

README

Pomati Sync Scripts

This directory contains utility scripts for synchronizing Pomati data and configuration between machines.

Scripts

pomatipull

Pull Pomati data and configuration from a remote host to your local machine.

Usage:

pomatipull [OPTIONS] <hostname>

Options:

  • -n, --dry-run - Preview changes without modifying files
  • -q, --quiet - Suppress non-error output
  • -h, --help - Display help message

Examples:

# Pull from a remote server
pomatipull myserver.local

# Preview what would be synced
pomatipull --dry-run 192.168.1.100

# Quiet mode
pomatipull --quiet workstation
pomatipush

Push Pomati data and configuration from your local machine to a remote host.

Usage:

pomatipush [OPTIONS] <hostname>

Options:

  • -n, --dry-run - Preview changes without modifying files
  • -q, --quiet - Suppress non-error output
  • -y, --yes - Skip confirmation prompt
  • -h, --help - Display help message

Examples:

# Push to a remote server (with confirmation prompt)
pomatipush myserver.local

# Preview what would be synced
pomatipush --dry-run 192.168.1.100

# Skip confirmation prompt
pomatipush --yes backup-server

Prerequisites

  1. SSH Access: Both scripts require SSH access to the remote host
  2. SSH Key Authentication: For best results, set up SSH key-based authentication
  3. rsync: The rsync utility must be installed on both local and remote machines
Setting up SSH Keys

If you haven't set up SSH key authentication:

# Generate SSH key (if you don't have one)
ssh-keygen -t ed25519 -C "your_email@example.com"

# Copy key to remote host
ssh-copy-id username@hostname

How It Works

Both scripts use rsync with the --delete flag to ensure exact synchronization:

  • Synced directories:

    • ~/.local/share/pomati/ - Database and data files
    • ~/.config/pomati/ - Configuration files
  • The --delete flag: Files in the destination that don't exist in the source will be removed. This ensures both locations are identical.

Safety Features

pomatipull
  • Tests SSH connectivity before attempting sync
  • Creates local directories if they don't exist
  • Provides colored output for easy status monitoring
  • Dry-run mode to preview changes
pomatipush
  • Tests SSH connectivity before attempting sync
  • Checks if local directories exist before pushing
  • Confirmation prompt before syncing (can be skipped with --yes)
  • Creates remote directories if they don't exist
  • Dry-run mode to preview changes
  • Continues even if config directory is missing

Common Use Cases

Initial Setup on a New Machine

Pull your existing Pomati data from your main machine:

pomatipull main-computer.local
Daily Sync Workflow

At the end of the day, push your work to a backup server:

pomatipush backup-server

At the start of the day, pull the latest data:

pomatipull backup-server
Preview Before Syncing
pomatipull --dry-run remote-host
pomatipush --dry-run remote-host

Troubleshooting

Connection Issues

If you see "Cannot connect via SSH":

  1. Verify the hostname is correct: ping hostname
  2. Test SSH manually: ssh hostname
  3. Check SSH key authentication: ssh -v hostname
Permission Issues

If rsync fails with permission errors:

# Ensure directories have correct permissions on remote host
ssh hostname "chmod -R u+rwX ~/.local/share/pomati ~/.config/pomati"

Installation

To make these scripts available system-wide, you can add the scripts directory to your PATH:

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL