Бекап данных на Mac с TimeMachine

История о том как я в два клика восстановил перезаписанный файл БД программы.
TextEdit хранит историю изменений документов, но что делать, если удалили что-то сложнее текстового файла? На самом деле невероятно просто. Нужно просто открыть нужную папку и просмотреть историю ее изменений в Time Machine. Причем, неважно, успел ли бекап синхронизироваться с внешний диском или нет – вся резервная копия хранится локально, пока не появится доступ к серверу. Да, занимает много места на диске, но оно того стоит.

У меня есть заметочник Bear, на котором мне лень пока покупать подписку, чтобы активировать поддержку облака. Пользуюсь я им только на Маке, поэтому между девайсами синхронизация и не нужна. Все заметки, кроме вложений, он хранит в стандартной SQLite в системных папках юзера, что меня давно уже смутило с точки зрения сохранности данных. Я благополучно добавил синк файла базы в iCloud с помощью тулзы Workbench (которая предназначена для другого рода бекапов, но все равно). В один прекрасный день бекап этого файла почему-то зафейлился и так больше никогда не загрузился в iCloud. Я подозреваю из-за размера файла, но это не так важно. И вот недавно я решил его починить. Workbench, конечно же, не апдейтился под Catalina, поэтому уже глючил. Случайно нажав там кнопку Download, я просто заменил текущий файл тем, что последний раз залился в облако два месяца назад. Вся моя писанина за последние 2 месяца умерла. В панике я пробовал просканить диск с помощью Disk Drill, облазил гугл, читая тупые советы, а потом решил посмотреть может таймашина даст мне файл хотя бы пару недельной давности (срок, когда я последний раз ее синкал с сетевым диском). А оказалось, что там была доступна версия этого файла несколькими часами ранее, поэтому я просто скопировал его оттуда, заменил текущий и спокойно вернул все свои данные.
Вывод – не забивать на Time Machine, следить за бекапами и контролировать работу этой фичи.

Конечно, не без минусов. Time Machine очень медленная штука. Несмотря на то что иногда у меня Мак сидит через провод в локальной сети, все равно копируются данные на сетевой диск будто это USB 2.0 флешка за пару баксов с Алиэкпресса. Это не заметно, если комп часто включен и работает дома, но аплоуд может иногда идти несколько дней. Еще я подозреваю, что тайм машина не очень оптимизирована для работы с не-MacOS девайсами. У меня частенько все отваливается, когда она решает сделать новый бекап с нуля и не может удалить старый – приходится затирать его вручную.
Кстати, как-то давно путем множества костылей с установкой SMB протокола на Linux, у меня получилось развернуть удаленный сервер с тайм машиной и бекапиться туда, но этот способ не прижился, потому что скорость аплоуда копий в внешнюю сеть был смешнейший – там за день загружало от силы гиг, вроде. Да и с шифрованием данных тоже был открыт вопрос. В общем, не стоит пытаться, если вдруг появится такое желание.


Data backup on MacOs with Time Machine

The story about how I restored the overwritten program database file in two clicks.
TextEdit stores the history of a document edits, but what to do if you delete something more complicated than a text file? In fact, it’s incredibly simple. You just need to open the right folder and view its change history in Time Machine. And it doesn’t matter if the backup has already managed to synchronize with the external drive or not – the entire backup is stored locally until the server is accessible. Yes, it takes up a lot of space on the disk, but it’s worth it.

I have a Bear app where I am too lazy to buy a subscription to activate cloud support. I use it only on Mac, so there is no need to synchronize between devices. All the notes except attachments are stored in standard SQLite in system folders of the user, which confused me in case of the data safety issues. I safely added a database file sink to iCloud using the Workbench tool (which is designed for other types of backups, but still). One day, for some reason, the backup of this file was failed and never uploaded to iCloud again. I think because of the size of the file, but it’s not that important. Recently I decided to fix it. Of course, the Workbench was not updated for Catalina and was already glitching. By accidentally clicking the Download button there, I just rewrote the current file with the version that was uploaded into the cloud two months ago. All my writing for the last 2 months has died. In a panic I tried to scan the disk with the help of Disk Drill, tried to search Google, reading stupid tips, and then decided to look maybe the Time Machine will give me a file at least dated a couple of weeks ago (the date when I last time sync with a network drive). And it turned out that there was a version of this file available a few hours earlier (!), so I just copied it from there, replaced the current one and quietly returned all my data.
Recap – do not ignore Time Machine, keep track of backups and control the stability of this feature.

Of course, not without disadvantages. Time Machine is a very slow thing. Despite the fact that sometimes I have Mac sitting through the wire in the local network, it still copies data to the network drive as if it were a USB 2.0 flash drive for a couple of bucks from the Aliexpress. This is not a problem if the computer is often turned on and running at home, but an uploud can sometimes take several days. I also think that Time Machine is not very optimized to work with non-MacOS devices. It often beaks at all when it decides to make a new backup from scratch and cannot remove the old one – I have to purge it manually.
By the way, a long time ago, I was able to deploy a remote server with a Time Machine by installing SMB protocol on Linux, but this method did not take hold, because the speed of a copy’s to the external network was ridiculous – it was loaded by the force of a GB, like, for a day. And with the encryption of data, too, the question was open. In general, do not try this method, if you suddenly have such a desire.

Share
Send
Pin
 221   2019   Backups   MacOS   Productivity
Popular