6 ms·
I just wrote myself a little script. Let's see, if it sticks ... $ cat bin/journal #!/bin/bash FILE=${HOME}/Dropbox/journal.txt echo >>${FILE} date
by beza1e1 16y ago
I just wrote myself a little script. Let's see, if it sticks ...
$ cat bin/journal
#!/bin/bash
FILE=${HOME}/Dropbox/journal.txt
echo >>${FILE}
date >>${FILE}
echo >>${FILE}
vim + ${FILE}
- jcw 16y agoI've been using this zsh function for a year or two: jr () { echo "---" echo "\n##"`date +" %a %D %l:%M%P"` >> ~/journal.txt cat >> ~/journal.txt } It usually emits 72 dashes, so that I can stay within that margin (manually, heh). Edited to not break HN. The '##' is because I habitually markdown format everything.
- Khroma 16y agoThat seems kind of unsafe to me, since it's all keeping it in one file.
- nlco 16y agoHow is it unsafe? (asking because I don't know, not to contradict)
- nitrogen 16y agoOne accidental command and every entry is lost, not just one entry or the most recent. Adding a "git commit journal.txt; git push offsite master" or something similar to your journal script will alleviate that risk. Edit: you also don't have file timestamps to show when an entry was actually written, in case that matters to you.
- billswift 16y agoMine is similar. My journal file is the hidden file ~/.journal and my script is in my home bin directory. It sets up a cat from STDIN, so I can just jot a few things down and ^D. I wanted something that would be as easy to use and non-intrusive as possible. And I used the %% on a line by themselves as the divider, as I also do in my Quotes_Aphorisms file, so scripts for searching and manipulating the fortune databases will also work on them. #!/bin/bash echo "%%" >> ~/.journal date +"%a %Y-%m-%d :: %X" >> ~/.journal cat - >> ~/.journal
- cpach 16y agoI wrote something similar just the other day :) I don't write daily though, only when I feel like it.
- deleted 16y ago[deleted]
- foxhop 16y agoI'm doing something similar. I found a cool vim command, ':r !date' for the current date. I'm using hg mercurial in addition to get additional backup security and logging. : P I also decided host the repo at bitbucket. This will let me have 'offsite' backups and the ability to pull my journal whenever I have a computer and internet... which is always.
- Khroma 16y ago"Pro-tip": you can also do :.!date