gbck— an easy way how to back up your dotfiles
I’d like to tell you a story which happened a few days ago. It was a lovely evening and I don’t know why exactly but somehow I’ve accidentally created a folder named “~”. That folder was very sad to have the same name as a shortcut to my home directory so I immediately decided to end its miserable existence and delete it.
I’ve gently placed my fingers on my keyboard and with all self-confidence and assurance that I’m the biggest terminal witcher in my neighborhood I run those commands:
rm -fr ~
Just one long second after I started to sweat like every time I’ve heard Creeper in my lovely Minecraft castle. STHAP!
CTRL+C! The very next moment I’ve been deep inside on the Encyclopedia of Gods and searched for some lovely gods to raise them because I’ve known that I need them. Yeah, it’s true. I’ve almost deleted my whole home directory.
Once I’ve recovered from that shock I finally deleted the mischievous folder
rm -fr "~" as intended… and suddenly out of a clear blue sky I’ve got an idea.
I’ve started to play with the idea. Let’s do some small project for fun. Let’s create a small utility which will be able to back up all my important data to Git repository. It should be easy to setup and most importantly it should be easy to actually do the backup. Let’s call it gbck.
gbck - 🗳 Intuitive lightweight tool for easy and seamless backup of your files into Git repository
With gbck it’s very easy to configure what files I do want to back up, or even what results of commands I want to back up. Let me be more specific. I have backup of my globally installed npm modules — you can get the list easily
npm list -g and with the very same effort you can tell gbck that you want to back up this stdout inside e.g.
npm-global-packages.txt file, it’s literally piece of cake. Check out my dotfiles to see more! Of course, you can configure which file or folder do you want to back up and you can also use few options to be event more specific, like exclude, include with glob support.
As many of you already know, there are several solutions how to deal with config files — check out the list at dotfiles.github.io. The easiest way is to use plain Git repository and then symlink files what you need from it, but the obvious downside of this approach is that you have to constantly think about it and commit your changes regularly. With gbck, it’s all about to just run
gbck and as a plus you can easily add files across you whole system without any caveats by editing one config file.
If you like the idea I’d be super happy if you proceed to the repository and try it on your own you might even give me a star if I’ve deserved. ⭐️
Thanks for reading! ❤️
P.S: And also If you like this article — it’s my first one on Medium. You can give me some claps! 👏
P.P.S: Do you use Google Chrome? Do you know Clappe? 👏