{"id":12516,"date":"2016-03-25T13:25:06","date_gmt":"2016-03-25T07:55:06","guid":{"rendered":"http:\/\/blog.taragana.com\/?p=10"},"modified":"2016-03-25T13:25:06","modified_gmt":"2016-03-25T07:55:06","slug":"how-to-auto-update-cnote-simple-cli-note-taking-application-to-google-drive-cloud","status":"publish","type":"post","link":"https:\/\/blog.taragana.com\/how-to-auto-update-cnote-simple-cli-note-taking-application-to-google-drive-cloud-12516","title":{"rendered":"How to auto-update CNote, Simple CLI Note Taking Application, to Google Drive Cloud"},"content":{"rendered":"
Super simple command line note taking tool for tracking breadcrumb trail during application development…<\/strong> CNotes is super-fast because it stores the notes locally, specifically in ~\/.notes. Backup CNote in Google Drive<\/strong><\/p>\n Questions:<\/p>\n
\nCNote is a super-simple command line based Note taking application which we use to track changes, take notes before signing-off etc. during development. It can be used on all variants of Unix, Linux and Mac OS. It’s power lies in quickly taking notes as you are working, without interrupting your flow. The notes are searchable and stored in a viewable text file. You can download it from CNote – CLI Note Taking Application<\/a> site or directly install it from command line with the following:<\/p>\nwget --no-check-certificate -q -O- https:\/\/raw.githubusercontent.com\/angsuman\/cnote\/master\/install.sh|bash -<\/code><\/pre>\n
\nAs we started piling up valuable notes you may start thinking what-if you machine crashes?
\nOne simple solution is to create a symbolic link to it from DropBox managed folder. This ensures DropBox updates it in their cloud whenever new notes are added.
\nDropBox Nazi says: No DropBox for you!<\/strong>
\nIncidentally I use CentOS 5.1.x (latest update) on Desktop, which is not supported by DropBox. I also use Raspberry Pi, which also is not supported by DropBox.
\nEnter Google Drive to the rescue<\/strong>
\nI tried to make DropBox command line tool work but I found out that DropBox command line client will not work without full installation<\/a>. This is not possible as CentOS 5.1.x and RaspBerry Pi are unsupported platforms.
\nGoogle Drive has a nice third-party command line tool called gdrive (download link<\/a>) which is just right for my purpose. So instead of wasting more time trying to make DropBox work on RaspberryPi etc., I decided to use Google Drive cloud for backup. I used an unused Google Account for this purpose.
\nGet access to Google Drive<\/strong><\/p>\n\n
\n
\n
gdrive<\/strong> upload ~\/.notes<\/strong><\/pre>\n
\n
\n
\n
nohup ~\/bin\/gdrive<\/strong> update 0B8qjySampleIDQzhNTaBcdEFg<\/em> ~\/.notes >\/dev\/null 2>&1 &<\/strong><\/pre>\n<\/li>\n<\/ul>\n<\/ul>\n
\n
chmod 700 ~\/bin\/updateNoteonGDrive<\/strong><\/pre>\n<\/li>\n<\/ul>\n
\n
n() {\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 echo `date \"+%Y-%m-%d %H:%M:%S\"`'> '\"$*\" >> ~\/.notes\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 tail -1 ~\/.notes\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 updateNoteonGDrive<\/strong>\n}<\/pre>\n<\/li>\n