Code Monkey home page Code Monkey logo

note-archiver's Introduction

Note Archiver

A shell script that archives Markdown files from various folders with an 'archive' tag. It can be run from a cronjob, making sure your other notes always stay fresh.


Installation

1. Download this repository

$ git clone https://github.com/aapit/note-archiver.git

2. Create a config file from the provided template

$ cd note-archiver
$ cp archiver.template.config archiver.config

3. Fill out config

Set the correct configuration values for your situation in archiver.config

4. Run the script

$ chmod +x archive-notes.sh
$ ./archive-notes.sh

5. Set up a cronjob

We don't want to run this script manually, but instead have the cron daemon do the archiving automatically in the background. Edit the crontab:

$ crontab -e

This opens your default editor and allows you to add this to the cron:

0 */4 * * * $HOME/Scripts/note-archiver/archive-notes.sh

Upon saving the crontab and exiting the editor, it's installed. The cronjob above would run the script every 4 hours.


Usage

I use frontmatter headers in all my Markdown notes. This allows me to store metadata in a more-or-less structured format.

---
created:    20190812
updated:    20190815
author:     David
tags:       foo, bar, archive
---

When a *.md note in one of the provided directories has a tag archive like above (or archief) , it's considered up for archival and will be moved to the provided archive folder the next time the cronjob runs.

note-archiver's People

Contributors

aapit avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.