4 ms·
I've built a similar system from scratch - also using this Dropbox daily notes file technique - except my script generates folders and sub folders for each year
by herodoturtle 6y ago
I've built a similar system from scratch - also using this Dropbox daily notes file technique - except my script generates folders and sub folders for each year (YYYY) and each month within each year (YYY-MM) whenever I instantiate a file on a certain day. Makes long term management much easier than having thousands of files in one folder. Same grep principles apply (and I use hashtags within my notes to track keywords).
- hachibu 6y agoThat's a very good idea. I might use that for my script. Thanks!
- asdff 6y agoWhy even break it down? If you are using grep and presumably editors that can go to a pattern anyway you might as well write to a single file.
- herodoturtle 6y agoI also manage my notes on the go by opening the Dropbox app on my phone and editing the txt files from there. Having subfolders helps with navigation on the Dropbox app.
- hiq 6y agoIn case of infrequent synchronizations you reduce the number of conflicts by having separate files rather than a single big one.
- jdshaffer 6y agoI'm terrible at scripting, but I'm curious how you handled that. Do you mind sharing the script you created?
- herodoturtle 6y agoSure thing. It's a script called "d" (for diary) that I keep in my home folder. I try minimise mouse usage, so I've got a keyboard shortcut for opening a terminal, and then in the terminal I run ./d === start of script === #!/bin/bash y=`date +%Y`; ym=`date +%Y-%m`; ymd=`date +%Y-%m-%d`; if [ ! -d "Dropbox/diary/$y" ]; then mkdir Dropbox/diary/$y fi if [ ! -d "Dropbox/diary/$y/$ym" ]; then mkdir Dropbox/diary/$y/$ym fi vim Dropbox/diary/$y/$ym/$ymd.txt === end script === I could probably refactor the hell out of this. But I'm an old beard that prefers explicit readability. For example I don't need to use YYYY-MM for the month sub-folders (I could just use MM), and similarly I don't need the full YYYY-MM-DD.txt for the day files (I could just use DD.txt) - so your preference may vary. And yeah I use .txt files because I can edit those natively in the Dropbox app on my phone too. Don't need any special apps installed to manage my notes on the go. In terms of the contents of the files, I've kept the searchability really simple by using hashtags, example: === Dropbox/diary/2020/12/04.txt === ## #keyword1 #keyword2 Here be notes on keyword1 and keyword2. ## #keyword3 Here be notes captured later on the same day on keyword3. These can span multiple lines if I want. ## #keyword4 Here be notes on keyword4 captured even later in the day. === I use the single hashtag keyword system for quick grepping (and future indexing if I want to build a searchable database out of this one day), and the double hashtag ## at the start of each note snippet so that I can parse individual snippets more easily. Hope that helps! :)
- jdshaffer 6y agoThank you so much! I really appreciate it! (And sorry for the way delayed response... I went to bed shortly after posting.)
- aGHz 6y agoQuick tip, you could replace the ifs with mkdir -p Dropbox/diary/$y/$ym
- herodoturtle 6y agoNeat, thanks!
- nickjj 6y agoThis is what I do too. I have 20 years of notes saved like this. I also open sourced a zero dependency Bash script that handles this at: https://github.com/nickjj/notes https://github.com/nickjj/notes It supports adding notes in 3 different ways: notes hello world appends the text to the YYYY-MM.txt dated file echo cool | notes same as above except you can pipe in text notes opens the YYYY-MM.txt file in your configured $EDITOR I use all 3 methods of input on a regular basis depending on what I want to jot down.