3 ms·
I have a very similar script that lets me write notes to a file with today's filestamp. I use it to keep track of what I've done on which days.
by Flimm 9y ago
I have a very similar script that lets me write notes to a file with today's filestamp. I use it to keep track of what I've done on which days.
- stevekemp 9y agoYup, I have a script `worklog` which boils down to this: #!/bin/sh mkdir ~/.worklog || true if [ -z "$1" ]; then cat ~/.worklog/$(date +%w).md else echo "$(date): $*" >> ~/.worklog/$(date +%w).md fi That gives a file per-week which can either have contents appended to it, or viewed. Usage is the obvious: $ worklog "I did some stuff" $ worklog [shows the output]
- vacri 9y agoAnother thing you can do is just use 'logger' and the syslog. You kinda have to be comfortable with viewing system logging, though; it's not for everyone - for example, I'm using sudo below just because I haven't set my user to view systemd's journal yet. $ logger hello $ logger <<EOF > this is a multiline > logging message > EOF $ sudo journalctl -t vacri -- Logs begin at Fri 2017-09-29 10:40:49 AEST, end at Mon 2017-10-02 23:44:13 AEDT Oct 02 23:40:24 myhost vacri[12320]: hello Oct 02 23:48:48 myhost vacri[12460]: this is a multiline Oct 02 23:48:48 myhost vacri[12460]: logging message syslog is good for some use-cases (eg centralisation), and not so good for others. I imagine most people would prefer your directory-of-easily-findable-history.