Good day comrades. After some time, as I got a job as a system administrator, I began to face such a problem:
Specific use case solved in this article
A suitable employee is requesting to restore the file that was yesterday / today / just-deleted, and now he needs blood-from-nose. At the same time, he does not remember the date of file creation, and he does not know the date of the last change and to know, because many different employees could work with the file at different times. And you need to restore, of course, the latest version. Either the file yesterday / today / just-something accidentally and fatally edited / overwritten. And you need to restore, respectively, the penultimate version.
So, the source data:
File name and address: at least approximatelyknown
Date of creation of the required file version: not known
Backup daily, incremental or equal to it in resource intensity. Full and differential are not used due to the limited amount of disk space in the storage / receiver backups.
The article came out too "watery", so I hid the main water under the spoilers.
Due to the specifics of this yuzkeys, it does not make sense to restore the file to the date of the full backup (if it is not daily, but weekly / monthly), because the version will most likely not be relevant. And from incremental - it is difficult, because the date of creating the necessary version of the file and the corresponding incremental backup is not known. Differential backup could solve the problem, but it is too resource-intensive, and not everyone can afford it.
Attempt to use regular backup / restore tool in Windows server
But the good of my predecessor took care of setting up backups on the file server (Windows Server 2003) ')
In no time, I open the Backup Software → Restore and Manage Media and precipitate. Each backup point is stored as a separate branch of the tree. In this case, the backup is incremental, which means that in each individual point only new and changed files!
And we climbed with the employee to sort through every point from yesterday and back. For the first time it took us half a day. Next time almost day. after the 3rd time, I realized that this can no longer continue.
Almost all existing systems offer several backup options from the list:
Full - create backup points with a full copy of all source files
Incremental - creating backup points with a copy of all files that appeared / changed during the time since the previous one was created
Differential - creating backup points with a copy of all files that appeared / changed during the time since the previous full backup point was created
Mirror — create and then rewrite a single point of a full backup. Files deleted from the source during the backup are removed from the receiver
Other products
And I began my long search for a tool that allows me to look at the folder as it was a few days ago.
And whether I was looking in the wrong place, or Google did not understand what I want. But I stumbled over and over again with the means that allow me only to restore the backup from a full copy and recursively add incremental ones. I could not give up incremental points in favor of only full or differential ones due to the limited size of the receiver backups. And not to say that all these alternative means were useless to me. On the contrary, I am pleased with my search for such a wonderful product as Cobian Backup , which I still use today. But they did not cover my use.
Lightbackup
Later, I found Light Backup - a miniature program that does exactly what I was looking for - allows you to look at the folder at the time of creating both full and incremental backup. True, by this time I had already solved my problem with BTsync on a non-windows server, and this program only works under windows. But I just could not pass by and use it for some specific tasks.
Bittorent sync
NAS
As time went. In the organization appeared, and then left idle NAS from QNAP. And as the manufacturer states: “Working with TS-221 is extremely simple - just click on the necessary icons!” Which, by the way, is not so far from the truth. Over time, I clicked Bittorent Syncin the 1st version as well. The benefit of QNAP took care of me by writing detailed instructions for setting up. True, I can not say that without it setting would be a problem.
BTSync , as a means of file synchronization rather than backup, can still play this role. The truth is realized only 1 of the 4 options described above - Mirror backup . But with one fundamentally important feature: he is able to save deleted or previous versions of modified files for a given period of time .
The “role” of the backup system is based on the following functions / settings:
The BTSync client must be installed both on the source and on the receiver. This is not a problem, due to cross-platform * In fact, the source can be a network folder, so the client can be installed on another PC ** DB (including settings) BTSync seems to be stored separately from binaries in the user's folder.So theoretically you can run 2 independent instans.And make the source and receiver 1 car
Reserved folders should be synchronized to the receiver in READ-ONLY mode. You do not want the changes to be synchronized in the opposite direction? * Please note that deleted / modified files in the receiver will no longer be synchronized, unless you select the “Overwrite any modified files” checkbox.On the one hand, this allows for the accurate removal of files that are unnecessary for synchronization, and on the other hand, the danger of containing non-consistent copies.I advise you to restrict the rights to write / change in the directory of the receiver for everyone except the user from whose name BTSync works.
On the receiver, in the settings of synchronized folders, the mode Keep deleted files in the archive must be enabled. In the advanced setup mode, the sync_trash_ttl parameter determines the number of days (max 30) for storing files in the archive folder.
"Schedule" of work in the functionality of BTSync is not included. But it is solved by starting and stopping the application via a third-party scheduler (cron, etc.) Unfortunately, this does not allow stopping synchronization by logical termination, since synchronization does not have as such logical termination.But I am satisfied with the BTSync launch mode at 18:30 and its forced completion at 7:00.During this time, the source and the receiver always have time to fully synchronize.
Now the same request of the employee is solved much easier and faster. I just go to the receiver in which the file / folder structure corresponds to yesterday's (18: 30+) source state. If the file was deleted / modified earlier (within 30 days) - it is enough to substitute " .sync \ Archive \ " and the files (as well as their versions) right there in the archive path.
Disadvantages of this approach
Load on the CPU - indexing shamelessly eats the CPU when the number of files in the hundreds of thousands. Because of what servers have tachycardia . Personally, it does not bother me.The file server is idle at night, and the backup server only performs this task, so it doesn't interfere with anything.And thus, I did not even try to back up a resource with a number of files of several million.
The lack of offline settings - it would seem extremely user friendly interface should simplify the configuration to the impossibility (the way it is) . But the setting itself, can only be carried out when the application is running btsync (remember about the CPU) . This problem partially costs disabling synchronization on the receiver side, and other crutches ... But I just do not set up backups during working hours, preferring to work with servers to shift the working day or transfer it to the day off.
Now dignity
Speed - I think the BitTorent protocol speed is not a secret to anyone. I do not have exact data, but I can only say that there were never enough attempts to implement a backup through smb | ftp
Cross platform - you can shove anywhere and anywhere. Judging by the wiki: Operating system: Windows, Linux, OS X, Android, iOS, Windows Phone, FreeBSD, and Amazon Kindle Fire Hardware platform: x86-64, x86 and ARM Interface Languages: English, German, French, Russian, Chinese, Korean, Japanese, Spanish, Dutch, Italian, Brazilian Portuguese, Portuguese, and Turkish
Extensibility / configurability - thanks to the mesh approach, there can be several receivers and sources. They may be behind NAT. They can be duplicated, etc. At the same time, the tuning practically does not increase its complexity with the growth of the source / receiver graph. So, in a couple of mouse clicks, it is possible to include a receiver outside your office / data center in the configuration, protecting yourself from the attack of aliens fires, etc.
Ease of maintenance — backup on the receiver side — this is exactly the same folder as the source side. And you can go into it by any method convenient to you. This really simplifies the recovery of individual files.
Security - all connections are encrypted-re-encrypted. BitTorent has a point on this topic.