📜 ⬆️ ⬇️

How I organized, synchronized and backed up files on my home computer



For the first time I ran into the problem of cluttering up hard drives on a computer in high school. Then I solved the problem by structuring all of my documents with Evernote, putting the necessary tags and transferring all the documents to this wonder software. All other files as lay in a heap, and continued to lie.

In the university of files has become even more, the number of computers at home has increased to 3 pieces, I began to make backups. For now, it is simple, making copies of the current folders on the computer, without really bothering with their structure. At the end of the training, I wondered whether it was worth storing a huge amount of my documents on external servers. Thinking a little, I decided that it was better not to do this and decided to get off the Evernote needle. I first thought about the structure of storing files on a computer so that even without searching, it is easy to find the necessary information. For each topic that interested me, I created a folder in the / home / username folder. I called it categories. Within each category there were subfolders-projects, the misc folder was obligatory in almost every folder, so that the file manager would not see heaps of randomly piled unstructured files. For example, I had the Bioinformatics / Aligner, Development / Projects / GameOfLife folders. There were clear rules for naming files and folders (without underscores, camelCase, folders with a capital letter, files with a small one). Everything seemed to be fine, but I was lazy and not always beautifully laid out the files in the right folders, which ultimately led to cluttering up my structure. I decided to try something else ...

I decided to raise mediawiki on localhost, and synchronize it between two main computers (one at home is stationary, the other is laptop, which is always with me). All synchronization of all folders in which the necessary files were stored (and backups too) was done using rsync. When I came home, I ran the iCameHome.sh script, which uploaded all changes to the home computer, which was also a backup server at the same time (and now it is also a backup server). When I left for work, I ran iWentOut.sh, which flooded the changes in the opposite direction. Everything seemed to be fine, my home wiki synchronized easily and easily, like the rest of the folders on the computer that I included in the rsync script. But I began to notice that the further, the less I fill my Wikipedia, since it takes some time to find the right article, despite the categories of articles. And I do not want to do it anymore. I didn’t like the search in mediawiki, maybe I didn’t read it and finished it. But basically here.
')
What I came to. My plan for switching to a new file structuring system consisted of two parts:



The first point is very simple. We take and install git-core, add the ssh key of the laptop to the list of available ones, prohibit ssh access with a password and open the ssh port of the stationary computer outside. Especially paranoid personalities are encouraged to configure port knocking. After that, for each folder that you want to synchronize, create a git repository and commit to it from both computers - from the stationary and laptop, depending on when and where you made the changes.

The second point is the virtualization of the workspace. First, I do typical virtuals: a virtual one with an raised mysql + IDE tuned to me, a virtual machine for secure web surfing, a virtual machine for some specific project. After the virtual machine is brought to mind, its full backup is done. Then only project folders are synchronized via git in the manner described above. All work is going on in virtual machines, I have Skype, Minecraft, Torrentokachalkal and VLC player on my host.

What are the advantages of this solution?



Minuses?



I would be happy to hear in the comments, who is how to solve the problem of backing up and synchronizing data between devices.

Source: https://habr.com/ru/post/237817/


All Articles