*/30 * * * *
The first section is the timers, mine is set to run on every minute interval that is divisible by 30 i.e. 30 and 60 or 1:30PM, 2PM, 2:30PM, etc.
/Users/bryanjenks/.local/bin/zk_sync
The second is what file is it executing (absolute path) which in this case is the script we made.
Finally, to make sure the job is quiet it is sending any script output (there shouldn't be any we used -q
a lot) to >/dev/null 2>&1
Now any changes I make to anything in my vault are pushed to GitHub every 30 minutes with an ISO timestamp for the files with changes. If no changes are made, nothing happens.
I keep the repo private, and this way I always have my ZettelKasten available where ever I go and under version control with Git.
I hope someone else enjoys the workflow 🙂️
Quick Summary of What We Covered
A Quick Recap of the main points of this article:
- Create a GitHub Repo
- Make your current ZettelKasten a local Git Repo
- Push that repo to your new fresh remote repo
- Create a script to sync your local and remote repo's
- Automate that scripts execution with Cron
Code?
If you would like all the example code used in the video / this article you can grab it:
Get the Code Here