Backup #
Make sure that your work does not depend on your laptop. You should be able to resume your work easily on another computer if your laptop gets lost, damaged, etc.
You should also be able to recover your data if you accidentally delete it from your hard drive.
Which information to back up #
With highest priority, make sure that there exist copies (outside of your hard drive) of:
- your passwords (and possibly identifiers), and
- your own work (code, reports, slides, notes, etc.).
These copies may be stored on the cloud, an external disk, another computer, etc.
Optionally, you may also back up:
- configuration files present in your home folder.
For development purposes, you generally do not need to back up:
- generated content (back up the code that generates it instead),
- large datasets (these should not be present on your laptop to start with),
- programs (they can be reinstalled).
How to back up #
Password managers #
For passwords, your password manager may provide an online backup option. Other password managers (like pass) may let you synchronize your passwords via git.
Git #
For your own work and/or configuration files, git can be an option.
A git repository is (roughly speaking) a directory that can be synchronized across different machines (see the dedicated chapter of this course for an introduction to git). For instance, you may create a (private) git repository for each course that you follow and/or each project that you start. Several providers (GitHub, Gitlab, Bitbucket, etc.) can host copies of your (public or private) repositories on the cloud for free.
The benefits are:
- the possibility to recover any previous state of your work (a git repository stores the whole history of modifications made to it),
- fine-grained control over your backup: for instance, you can use a ".gitignore" file to exclude files or subfolder that do not need to be backed up.
Note. If a git repository is a subfolder of another git repository, then the inner repository is not included in the history of the outer one.
Limitation. Git is not suited to large volumes of data (more than 1 GB in the same repository). This is usually not an issue for your own work (code, notes, reports, etc.) as a student in computer science. However, git should not be used to back up large collections of images, audio files, videos, etc.
Other solutions #
Numerous programs allow you to back up (part of) the content of your hard drive. One of them may be pre-installed on your operating system.
You can back up content on a device that you own (e.g. on an external hard drive), or on the cloud. In the latter case, some fee may apply (depending on the volume of data).
Restore points #
Programs such as System restore (Windows), macOS Recovery (macOS) or Timeshift (Linux) allow you to create snapshots of your system (typically for what lives outside of your home folder), and revert your system’s state to one of these snapshots.
This can be useful in case of a corrupted system. However, it may be difficult to determine at which point in time the system was “healthy”. Note also that in such scenarios, a fresh re-install may be a simpler option to restart on a sane basis.