Skip to content

s0um0r0y/personal-journal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“” My Automated Daily Journal

A simple, command-line journaling system that automatically creates, structures, and backs up your daily entries to a Git repository. Never miss an entry, and keep your thoughts organized and safe.

✨ Features

  • Automatic File Creation: A single command creates a new, dated journal entry.
  • Structured Template: Each entry starts with a clean, pre-defined Markdown template (Morning, Afternoon, Night, Takeaway).
  • Organized Folders: Entries are automatically saved into YEAR_MONTH folders (e.g., ~/journal/2025_10).
  • Instant Editing: The new journal file opens immediately in VS Code, ready for you to start writing.
  • Daily Automated Backups: A cron job automatically commits and pushes your journal to a remote Git repository (like GitHub) every night.

βš™οΈ How It Works

This system uses two core scripts:

  1. journal.sh : The main script for creating entries.
  • It determines the correct folder and filename for the day.
  • It creates the directory if it doesn't exist.
  • It populates the new Markdown file with a formatted date and the standard template.
  • It opens the file in VS Code using the code command.
  1. push-journal.sh: The backup script.
  • It navigates to the journal directory.
  • It adds all new or modified files.
  • It creates a commit with a message like "Journal entry for 2025-10-10".
  • It pushes the commit to the main branch of your remote repository.

A cron job is used to schedule push-journal.sh to run automatically at a set time every day.

πŸš€ Setup Guide

Follow these steps to get your automated journal up and running.

Prerequisites

  • A Unix-like terminal (Linux, macOS, WSL on Windows).
  • Git installed.
  • Visual Studio Code installed, with the code command available in your PATH.

Step 1: Set Up the Git Repository First, prepare your local directory and link it to a remote repository on GitHub, GitLab, or another service.

Navigate to your home directory and create the main journal folder

cd ~
mkdir journal
cd journal

Initialize a Git repository

git init
git branch -M main

Create a new, empty repository on GitHub (or similar)

Then, link your local repository to it. (Use SSH for password-less pushes)

git remote add origin [email protected]:YOUR_USERNAME/YOUR_REPOSITORY.git

Step 2: Add and Prepare the Scripts Place the journal.sh and push-journal.sh scripts in a convenient location, such as your home directory (~/).

Make them executable:

chmod +x ~/journal.sh
chmod +x ~/push-journal.sh

Step 3: (Optional) Create a Quick Alias

For easy access, create an alias for the journal script in your shell's configuration file (~/.bashrc, ~/.zshrc, etc.).

Add this line to your .bashrc or .zshrc

alias journal='bash ~/journal.sh'

# Reload your shell configuration
source ~/.bashrc

Now you can simply type journal to create a new entry.

Step 4: Schedule the Daily Backup Set up a cron job to run the push script automatically.

  1. Open the crontab editor:
crontab -e
  1. Add the following line to the file. This example will run the backup every day at 11:00 PM (23:00).

Minute Hour Day(Month) Month Day(Week) Command

0 23 * * * /bin/bash $HOME/push-journal.sh

Save and exit the editor.

✍️ Daily Usage

  1. Open your terminal.
  2. Run the command journal (or bash ~/journal.sh if you skipped the alias).
  3. Your new journal entry will open in VS Code. Write your thoughts.
  4. That's it! Your work will be automatically backed up at night.

Journal format

$( date '+%A, %B %d, %Y' )

## Morning
- 

## Afternoon
- 

## Night
- 

## Takeaway/Lesson
-

Happy Journaling!

Credits

About

trying to use markdown and bash script to have an automated daily personal journal entry.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages