There are more or less similar things in real life. For example, the computer blue screen, virtual machine suddenly broken, resulting in a day of re configuration work environment, for example, mistakenly deleted album data or development documents in the computer, resulting in rearrangement or writing, or even directly broken or stolen computer.
This series of problems are more or less related to our backup, today I mainly share a few of my daily use of more backup tools to you.
Git version control system
When it comes to backup, you have to be a version control system –Git.
First of all, let’s briefly explain what version control is. It is basically a system that records changes to the contents of one or more files for future revision.
With Git, you can easily trace all versions of history, you can make changes at will, and you can easily go back to where you were before, with little extra work.
At this point, I would like to explain why I do not like to use Word for document writing, but Markdown. Markdown is not only easy to use and easy to typeset, but also an MD file is an ordinary text file, while docX generated by Word is a binary file, which can only listen to changes but cannot recover and compare changes.
Remember when we wrote our senior thesis in college and had 7 or 8 versions of word documents?
It is very difficult to compare each version or multiple versions of each paper, which cannot be well differentiated and restored by management. (Even if Word has comparison features)
The actual situation is that we can try Git+Markdown for management writing, and then generate docX through Pandoc, which can carry out version control and cross in standard format.
Rsync file backup
For example, when we transfer code to an online server during development, or back up database or log files, etc.
Main features:
Data is compressed and decompressed to reduce bandwidth usage
Differential calculation, file comparison, file update before transfer (i.e., incremental synchronization)
Simple usage:
rsync -avz source_dir dest_dir(username@host:PATH) --exclude "*.pyc*"--delete -v verbose verbose output-a-z -h human-readable --exclude files that do not include PYC, --delete files that do not exist on the source end (if not, they will not be deleted by default)# source_dir '/' will copy all contents to the destination. If not, the same directory will be created on the source.
Copy the code
In daily work, we often use crontab to periodically execute rsync command for backup data, but for easier management of our operations on services, we can add shell file of the command into version control for unified execution of scheduled tasks through Celery Beat.
Dropbox cloud storage
Dropbox is an online cloud storage service originally written in Python that synchronizes files with the Internet using cloud computing to store and share files and folders.
Main features:
Fully automatic backup, incremental update
Supports two-step authentication for more secure storage
Sharing/collaboration is free and convenient
IFTTT auxiliary functions
If you give up a good tool because of the Qiang problem, it is not worth the cost. I suggest you all try it.
A Time Machine
Finally, back up your entire operating system –Time Machine, a built-in backup tool for Mac OS X, automatically backs up your Mac on an hourly, daily, or weekly basis.
Backup can be done locally or on an external keyboard. For example, LaCie is used in my home external hard disk system backup.
If you want to upgrade the system or migrate data, Time Machine will be your best security line. It is strongly recommended for Mac students to enable backup.
The above four tools, our subtle changes from a file (Git), to the command line file synchronization (Rsync) incremental backups, graphical user interface to the Dropbox file management of cloud storage services, in the end the entire operating system backup, made a brief introduction, hope you can go to try and use these tools, Our file data will become more secure.
If you have questions or better recommendations, feel free to share your productivity tools in the comments.
This article was first published on wechat