📜 ⬆️ ⬇️

Automatic backup of configs using DropBox

Once again, making sure that automatic backup is a very useful and necessary thing, I decided to think about how to simplify this process. For me, first of all, various configs such as the Miranda database, Keepass password database, iTunes library and a lot of other small things are most valuable, and I really like DropBox’s wonderful freemium service that allows you to automatically track file changes and backup them, but the logic his work involves copying all the necessary files into one folder, which is not very good for storing configs. It would seem, it is worth thinking about another solution, but for some reason I really wanted to attach to DropBox, so I began to dig in this direction.

Disclaimer aka "Excuse"


Of course, all the actions described below are commonplace and intuitive to any professional geek. However, the purpose of writing this post in the first place is to later give a link to this work to those who are not so deeply versed in the subject, but eager to solve the problem without special hemorrhoids. In addition, the author of this post (I mean) is afraid after a while to forget exactly how he could achieve the solution of the problem, and therefore this post was also written so that he (that is, I) could always turn to him and remember what he (that is, I) did.
Everything mentioned below has a definite meaning for any operating system where DropBox is running, but first of all it means Windows. For Linux, everything is described in detail here .


Decision


Actually, the solution is very simple - if DropBox wants all the files that it should monitor, were in one folder, you need to ensure this. Since configs cannot be moved, they need to be in two places at the same time. The task of ensuring this quantum uncertainty is perfectly solved by symbolic links, they are also symlinks (if you don’t know what it is, then I advise you to read more about it in Wikipedia ). If you read vlom, and you don’t know what symlinks are, then in short it is such a thing that allows you to place one file in two different places in the file system - i.e. exactly what we need.
In general, symlinks are a feature of the file system, and it is typical of UNIX-like operating systems. However, in Windows, starting with NTFS 5, there is also such functionality, so if you have Windows Vista or newer, then you can place the files you need in the DropBox folder, and where they need to be added, you need to make symlinks.
This is done using the mklink command.
MKLINK [[/D] | [/H] | [/J]]

/D .
.
/H .
/J .
.
( ),
.

However, if you don’t really like the Windows command line (yes, yes, I know that all the really cool guys never get out of the command line, but sometimes there are still people who find the GUI for some reason more comfortable) there is a great solution. This is an add-on for the Windows Link Shell Extension , which allows you to make a link to it using the right-click on a file.
NB Do not be alarmed when you see that the file you created in the simlink file has a zero size in the folder, this is normal.
.

Screenshot Example


It is necessary to make an automatic backup of the Miranda profile file. It is stored on the SD card, so you must first format it in NTFS. The desired file must be copied to the DropBox folder, and the original deleted.
')
Image Hosted by ImageShack.us

After that you need to create a symlink to the file stored in the DropBox folder.

Image Hosted by ImageShack.us

Now in place of the original file will be a symlink, which will point to the file lying in the DropBox folder:

Image Hosted by ImageShack.us

You need to make sure DropBox really saw this file.

Image Hosted by ImageShack.us

In order to check whether DropBox will register changes in the file, you can run Miranda, make some changes in the settings, and look at the version history of your file.

Image Hosted by ImageShack.us

Acknowledgments


I would never have thought of this decision if my hysterical cries on Twitter were not hailed by @Pushken_vbane , @Targence , @Bockra , @Afalina , @ Pechkin1007 , @Vykser . Thank you guys.

Special thanks to Habrayuser baxtep2 , who drew attention to the features of DropBox with symlinks and the fact that it is better to store the original files in the DropBox folder, and put the symlinks to where the files themselves were before.

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


All Articles