I take a lot of notes when I am either working on projects or researching so in Backtrack Linux I use KeepNote to accomplish this. KeepNote is a great little note application that provides notebook and tab functionality which pretty much covers what I need to do. One thing KeepNote doesn’t offer right out of the box is an easy way to backup notes from the command line so I took another backup shell script and converted it to backup KeepNote notes on Backtrack.
Shell Script To Backup KeepNote Notes On Backtrack:
- #!/bin/sh
- #
- # backup keepnote scirpt
- # intended to be used in a daily cron
- #
- # settings
- note_location="/root/notes"
- backupdir="/home/backup/keepnote"
- # setup filename
- backupdate=$(date +%Y-%m-%e_%k:%M:%S)
- host=$(hostname -s)
- keepnotefile="keepnotes-$host-$backupdate.tgz"
- # echo status message
- /bin/date
- echo "Archiving KeepNotes From $note_location to $backupdir/$keepnotefile"
- # backup dem keepnotes
- /bin/tar -czf $backupdir/$keepnotefile $note_location
- # echo success
- echo "KeepNotes Backed Up"
You will need to set to variables including the note_location and backupdir located at the top of the script. KeepNote saves its notes to the users home directory so on Backtrack this would typically be /root. Look for a folder with the name of the first Notebook you saved and this should contain all of your notes. The backup directory can be anywhere but I personally prefer /home/backup which is a user I typically create for backing things up such as MySQL databases and other configuration files. Within the /home/backup directory I create a keepnote directory, create a script with the contents above, make the script executable using chmod +x, and then add a cron entry to backup my KeepNote notes once a night. The cron entry I use can be see in this article.