Skip to content

Instantly share code, notes, and snippets.

@ehrktia
Last active December 13, 2025 19:23
Show Gist options
  • Select an option

  • Save ehrktia/c6a9222bc26208b6acd914f939109822 to your computer and use it in GitHub Desktop.

Select an option

Save ehrktia/c6a9222bc26208b6acd914f939109822 to your computer and use it in GitHub Desktop.
sync
#! /usr/bin/env bash
clear
set -euo pipefail
declare -A dir_dict=(["$HOME/.config/helix"]="config.toml" ["$HOME/.config/fish"]="/")
for i in "${!dir_dict[@]}"; do
dir=$(basename "$i")
echo "syncing file folder: $dir..."
echo "syncing files: ${dir_dict[$i]}...."
rsync -avz "$i/${dir_dict[$i]}" ."/backup/$dir"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment