File tree Expand file tree Collapse file tree 6 files changed +32
-2
lines changed Expand file tree Collapse file tree 6 files changed +32
-2
lines changed Original file line number Diff line number Diff line change 11# STANDARD(?) UNIX NOTES
22# RELEASE NOTES
33
4+ 2.4
5+ - Added backup sub-command (creates GnuPG encrypted
6+ tarball in HOME)
7+
482.3
59 - Added GNU shred(1) for file deletion where available
610 - fixed bug #26 (wrong extension for 'edit' -> .asc)
Original file line number Diff line number Diff line change 33
44 ROADMAP
55
6+ 2.4 Added backup sub command
7+
682.3 Use GNU shred(1) where available
79
8102.2 Migrate to ascii encoded GPG files (see RELEASE-NOTES.md)
@@ -48,6 +50,5 @@ FUTURE FEATURES
4850 - zsh completion
4951 - FreeBSD .PKG packaging
5052 - FreeBSD ports configuration
51- - encrypted backup/restore
5253 - PIV card support
5354 - Issue #17 BUG - import truncates filename if spaces in filename
Original file line number Diff line number Diff line change @@ -51,6 +51,10 @@ $ ykman openpgp set-touch enc cached
5151```
5252
5353
54+ ## Sub-command backup
55+
56+ Backup your notes and journal entries to a GPG encrypted tar file (in $HOME)
57+
5458## Sub-command add | insert
5559
5660To add a note simply issue the command
Original file line number Diff line number Diff line change @@ -78,6 +78,8 @@ the KEYID of the private key you wish to use.
7878issues with other keys, then run \fB notes newkey <keyid> \fP . Notes will
7979replace the keyid automatically in the config file.
8080
81+ Journal entries can be backed up using the backup sub-command of notes(1).
82+
8183.SH SHELL INTEGRATION
8284
8385Standard Unix Notes system supports bash completion for notes(1),
Original file line number Diff line number Diff line change @@ -85,6 +85,14 @@ Displays the config file
8585~/.notes/config
8686to the terminal. This is a quick way of determining that GPG KeyID is in use.
8787
88+ .SY backup
89+ .YS
90+
91+ Backup your notes directory to a GPG encrypted tar file placed in your
92+ $HOME directory. Backups can be tested using the following command:
93+
94+ $ gpg -d ~/unix-notes-backup-20210630_1503.tar.asc | tar tv
95+
8896.SY help
8997.YS
9098Displays a quick help page displaying available commands.
Original file line number Diff line number Diff line change @@ -28,7 +28,8 @@ GPG_OPTS=" --quiet --yes --compress-algo=none --no-encrypt-to"
2828GPG=" gpg"
2929EDITOR=" ${EDITOR:- nano} "
3030PAGER=" ${PAGER:- more} "
31-
31+ TIMESTAMP=" ` date \" +%Y%m%d_%H%M\" ` "
32+ BACKUPFILE=" ${HOME} /unix-notes-backup-${TIMESTAMP} .tar.asc"
3233# Use shred if available
3334SHRED=" ` which shred` "
3435if [ $? = 0 ]; then
@@ -370,6 +371,7 @@ GPG encrypted notes system for BSD and Linux systems
370371
371372 notes init initialise notes system
372373 notes config display config file
374+ notes backup backup $NOTESDIR to GPG encrypted tar file
373375 notes newkey email change GPG key
374376 notes help show help
375377 notes version show version
@@ -435,6 +437,14 @@ cmd_config () {
435437 echo The Journal uses the directory $JOURNALDIR
436438}
437439
440+ cmd_backup () {
441+
442+ get_recipient
443+
444+ echo running tar backup to $BACKUPFILE
445+ tar cv ${NOTESDIR} | gpg -ear ${KEY} ${GPGOPTS} > ${BACKUPFILE}
446+ }
447+
438448cmd_tree () {
439449 tree -I Journal ${NOTESDIR}
440450}
@@ -630,6 +640,7 @@ COMMAND="$1"
630640case " $1 " in
631641 init) shift ; cmd_init " $@ " ;;
632642 config) shift ; cmd_config " $@ " ;;
643+ backup) shift ; cmd_backup ;;
633644 tree) shift ; cmd_tree ;;
634645 licence|license) shift ; cmd_licence " $@ " ;;
635646 default) shift ; cmd_default " $@ " ;;
You can’t perform that action at this time.
0 commit comments