Skip to content

Instantly share code, notes, and snippets.

@e3ntity
e3ntity / sync.sh
Last active March 4, 2026 14:48
background file-sync daemon that watches a local directory for changes via inotifywait and automatically rsyncs them to a remote host over SSH
#!/bin/bash
set -euo pipefail
DEFAULT_EXCLUDES=(.git)
STATE_DIR="/tmp/sync-sessions"
log() { echo "[$(date +%H:%M:%S)] $*"; }
state_dir() { mkdir -p "$STATE_DIR"; echo "$STATE_DIR"; }
money = 200 # Starting money
money_invested = 1.0 # Percentage of money invested (1.0) for everything
yearly_income = 1000 # Yearly income
taxfree_income = 500
yearly_spending = 1000 # Amount spent yearly
annual_return = 0.03 # Annual return for invested money (0.05) for 5%
period = 4 # Time period to calculate for
ic = 0 # income class, dont change!