Daily Note Snapshot

by Seiichi Arai
5
4
3
2
1
Score: 50/100

Description

Take snapshots for obsidian daily note

Reviews

No reviews yet.

Stats

0
stars
21
downloads
0
forks
21
days
24
days
24
days
0
total PRs
0
open PRs
0
closed PRs
0
merged PRs
0
total issues
0
open issues
0
closed issues
1
commits

Latest Version

24 days ago

Changelog

README file from

Github

Daily Note Snapshot

An Obsidian plugin that copies a daily note into a snapshot folder at a scheduled time. The copy is named after the snapshot date, so the folder accumulates a dated history of the note.

What it does

Every day at the configured time (or on demand), the plugin:

  1. Reads the configured source note, e.g. DailyNote.md.
  2. Copies its content verbatim — frontmatter included — into the snapshot folder, e.g. DailyNoteSnapshot/26-08-08.md.

With the defaults (snapshot at hour 0, previous-day naming on), the snapshot taken just after midnight is named after the day that just ended, so each file holds the note as it looked at the end of that day.

If a snapshot with the same name already exists, it is overwritten. That is by design: a coarser date format (for example YY-MM) simply means "keep the latest snapshot per period".

When the source note does not exist, nothing is written.

Usage

  • Command palette: run Take a snapshot of the daily note.
  • Ribbon: click the camera icon in the left ribbon.
  • Settings: the Take a snapshot now button at the bottom of the plugin settings runs it immediately — handy for testing a configuration.
  • Automatic: enable the scheduled snapshot in the settings (on by default). Obsidian has to be running for the schedule to fire; a run missed while the app was closed is caught up the next time it starts on the same day.

Settings

Setting Default Description
Source note DailyNote.md Vault path of the note to snapshot. The .md extension is optional.
Snapshot folder DailyNoteSnapshot Folder the snapshots are stored in. Empty means the vault root. Missing folders are created.
Snapshot name format YY-MM-DD Moment.js format for the snapshot file name. Choose how much detail to include, e.g. YYYY-MM-DD or YYYY-MM-DD_HH-mm-ss. Colliding names are overwritten. Slashes create subfolders.
Name the snapshot after the previous day on Use the previous day for the file name. Keep it on with a midnight schedule so the file carries the date of the day that just ended; turn it off for schedules later in the day.
Take a snapshot automatically on Whether the scheduled snapshot runs.
Snapshot hour 00 Hour of day (0-23, 24 hour clock) the automatic snapshot happens, at the start of the hour.

Development

pnpm install
pnpm dev        # bundle with esbuild in watch mode
pnpm build      # type check and produce main.js
pnpm test       # run the vitest suite
pnpm lint       # eslint with the obsidianmd preset

License

0-BSD