DEV Community

Indra Wahyu
Indra Wahyu

Posted on • Edited on

1

Push Markdown Note File like Obsidian to GitHub using Cronie

I wanted to push my markdown files to github automatically and I solved it with a cron job.

first, I commit my markdown directory and pushed it to github manually, next I created a script to push it automatically. script

#!/usr/bin/env sh

pusher-obsidian=/home/spot/spotspace/pusher-obsidian

cd $pusher-obsidian

git pull origin main -q

result=$(git status --porcelain | wc -l)

if [[ $result -eq 0 ]] ; then
        exit 0

fi
        git add .; git commit -q -m "$(date +"%c")"; git push origin main -q
Enter fullscreen mode Exit fullscreen mode

I use a cron job to run script

crontab -e
Enter fullscreen mode Exit fullscreen mode

and put this

@reboot /bin/sleep 120 ;  <script_directory>
Enter fullscreen mode Exit fullscreen mode

reference

Top comments (0)

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more