4 backup tools I use

It goes without saying that backup is very important to our daily work. Before, GitLab mistakenly deleted 300G data to restore the data in real time. Later, there was an embarrassing scene where Tencent Cloud failed to lose customer data and suffered millions of claims.

There are more or less similar things in real life. For example, the computer has a blue screen and the virtual machine suddenly breaks down, causing the work environment to be reconfigured all day long. For example, I accidentally deleted the album data or development documents in my computer, resulting in rearrangement or writing, or even the computer was broken or stolen.

This series of problems are more or less related to our backup. Today I will mainly share a few backup tools that I use daily.

Git version control system

5b9e3095995e104540250322a31d07ba.webp


When it comes to backup, there is no doubt that it must be a version control system - Git .

First, let us briefly explain what version control is. It is mainly a system that records changes in one or more files for future review of version revisions.

With Git, you can easily trace back to the various versions of history, you can change the changes at will, and finally it is easy to return to the previous state, and it can be achieved with almost no additional work.

Having said that, I have to explain why I don’t like to use word to write documents, but use Markdown. Not only is Markdown simple and easy to use and easy to typeset, there is also an md file that is a normal text file, and the docx generated by word is a binary file. , Can only monitor the changes but cannot restore and compare the changes.

Remember when our university was writing a graduation thesis, there were 7 or 8 versions of the word document scene?

It is very difficult to compare each version or multiple versions of the paper each time, and it cannot be differentiated well and managed to restore it. (Even if word has a contrast function)

In fact, our papers can try Git+Markdownto manage writing, and then Pandoc generate docx, which can be version controlled and can be exchanged in standard format.

Rsync file backupd4dab2bd85255f4f0ba03ffb1452caf8.webp

After talking about file monitoring and control, let's talk about Rsync. It is a command line tool commonly used by Linux system administrators. It is often used for data copy backup and is mainly used for operations during development.

For example, when we transfer code to an online server during development, or back up databases or log files, etc.

main feature:

  1. Data transmission is compressed and decompressed to reduce bandwidth usage

  2. Difference calculation, file comparison, and file update are only transferred (ie incremental synchronization)

Simple usage is as follows:

rsync -avz source_dir dest_dir(username@host:PATH) --exclude "*.pyc*" --delete
其中 -v  verbose 详细输出
    -a  归档模式,递归方式传输文件
    -z  压缩文件传输
    -h  human-readable, 输出友好
    --exclude 不包括 pyc的文件,
    --delete删除在源端不存在的文件(不加不会默认删除)

    # source_dir 带 `/ ` 会把所有内容复制到目的端,不带就会创建复制同名目录,源端同理。

In our daily work, we often use crontab to execute rsync commands on a regular basis, but in order to manage our service operations more conveniently, we can add the command shell file to version control, and use Celery Beat to perform unified execution of timed tasks.

Dropbox cloud storageb1ff61a55229bc99f1cc7126f3e98c6e.webp

After talking about the command line backup of data files, let's briefly talk about the graphical user interface Dropbox.

Dropbox is an online cloud storage service, originally written in Python, and synchronized with Internet files through cloud computing for storing and sharing files and folders.

main feature:

  1. Fully automatic backup, incremental update

  2. Support two-step authentication, storage is more secure

  3. Free and convenient sharing/collaboration

  4. IFTTT accessibility

If you give up excellent tools because of Qiang's problems, it is not worth the loss. I suggest everyone try it.

Time Machine

1802f47dbf3a44d1fb8813f6bc422023.webp


Finally, let's talk about the entire operating system backup-Time Machine (Time Machine), it is a built-in backup tool of Mac OS X, it can automatically back up your Apple computer hourly, daily or weekly.

It can be backed up locally or by an external keyboard. For example, my home uses LaCie external hard drives for system backup.

If you want to perform system upgrades or data migration, Time Machine will be your best line of defense. It is strongly recommended that Mac students turn on for backup.

d7eab8fe5f2ae6137a918d9d85fc8ddb.webp

Restore system diagram at any time

The above four tools, from minor file changes (Git), to command-line file incremental synchronization (Rsync) backup, to the file management of the cloud storage service of the Dropbox graphical user interface, and finally the entire operating system backup. A short introduction, I hope you can try it out. After using these tools, our file data will become more secure.

If you have questions or better recommendations, please leave a message to share your efficiency tools.


Guess you like

Origin blog.51cto.com/15009257/2552401