# Daily Note Snapshot An [Obsidian](https://obsidian.md) 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](https://momentjs.com/docs/#/displaying/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 ```bash 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