Skip to content

Instantly share code, notes, and snippets.

@yigitozgumus
Created January 31, 2021 12:39
Show Gist options
  • Save yigitozgumus/38300a0c46e6e26ab3851300661704d6 to your computer and use it in GitHub Desktop.
Save yigitozgumus/38300a0c46e6e26ab3851300661704d6 to your computer and use it in GitHub Desktop.
This script helps you to syncronize your notes to a private repo periodically
#!/bin/bash
OBSIDIAN_CONFIG="obsidian_sync.sh"
LOCATION=$( echo `pwd` | sed 's/ /\\ /g' )
# Obsidian repo sync
crontab -l
echo "0 22 * * * cd "${LOCATION}" ; ./${OBSIDIAN_CONFIG} >> /tmp/cron.out 2>&1" | sort - | uniq - | crontab -
printf "\nCronjob is added.\n"
crontab -l
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment