The purpose of this tutorial is to show how to install Timeshift on Ubuntu 22.04 Jammy Jellyfish and use the program to perform a backup of the system, and subsequently restore the system from that backup.
backup
How to create and extract cpio archives on Linux Examples
Although the cpio archiving utility is nowadays used less than other archiving tools like tar, it is still good to know how it works, since it is still used, for example, to create initramfs images on Linux and for rpm packages, which are used mainly in the Red Hat family of distributions.
LVM backup and restore snapshot in Linux
Logical Volume Manager (LVM) is used on Linux to manage hard drives and other storage devices. As the name implies, it can sort raw storage into logical volumes, making it easy to configure and use.
How to use rsync over ssh
rsync stands for “remote sync” and is a powerful command line utility for synchronizing directories either on a local system or with remote machines. It’s built into nearly every Linux system by default which allows users to perform rsync over ssh communication/backup.
Rsync examples in Linux
rsync stands for “remote sync” and is a powerful command line utility for synchronizing directories either on a local system or with remote machines. It’s built into nearly every Linux system by default and this tutorial will help you to understand rsync better by providing you most common rsync examples administrators use to keep the data synchronised across multiple server/hosts.
Some users mistakenly think of rsync as a file copying tool, like cp
or scp
.While there’s some overlap, rsync excels in synchronization, specifically. In other words, it can take a source directory and make an identical destination directory.
Linux commands to back up and restore MySQL database
It’s always a good idea to take frequent backups of your MySQL or MariaDB databases. They can potentially contain thousands of lines of irreplaceable data. Many users may be confused on how to back up their databases at first, as the process differs quite a bit from backing up ordinary files. The process of restoring a backup must also be known, as there’s no point in having a backup if the user cannot reliably restore it.
In this guide, we’ll go over various command line examples to back up and restore MySQL or MariaDB databases on a Linux system. You can then use these commands to make regular backups of your databases, or even add them to a Bash script that can do most of the work for you. Another option is to configure cron to make regularly scheduled backups of your databases.
In this tutorial you will learn:
- How to back up MySQL or MariaDB database (one or multiple)
- How to restore a MySQL or MariaDB database backup
Docker container: Backup and Restore
The purpose of this guide is to go over the step by step instructions of how to back up a Docker container on the Linux command line. We’ll also show how to restore a Docker container from backup. This can be done on any Linux system where Docker is installed, and will work on any Linux distribution.
To understand the Docker container backup and recovery process we first need to understand the difference between a Docker image and a Docker container. A Docker image contains an operating system with possibly one or more preconfigured applications, whereas a Docker container is a running instance created from an image.
In this tutorial you will learn:
- How to back up a Docker container on Linux
- How to restore a Docker container on Linux
How to generate and backup a gpg keypair on Linux
Gnu Privacy Guard (gpg) is the Gnu project free and open source implementation of the OpenGPG standard. The gpg encryption system is called “asymmetric” and it is based on public key encryption: we encrypt a document with the public key of a recipient which will be the only one able to decrypt it, since it owns the private key associated with it. Gpg allows us also to sign documents using our private key and let others verify such signature with our public key. In this tutorial we will see how to generate and create a backup of a gpg keypair.
In this tutorial you will learn:
- How to install gpg
- How to generate a gpg keypair
- How to list our keys
- How to create a backup/export a gpg keypair and trustdb
How to setup raid1 on Linux
RAID stands for Redundant Array of Inexpensive Disks; depending on the RAID level we setup, we can achieve data replication and/or data distribution. A RAID setup can be achieved via dedicated hardware or via software. In this tutorial we see how to implement a RAID1 (mirror) via software on Linux, using
the mdadm utility.
In this tutorial you will learn:
- The peculiarities of the most used RAID levels
- How to install mdadm on the major Linux distributions
- How to configure a RAID1 with two disks
- How to replace a disk in the RAID array
How to keep files and directories synchronized across different devices using syncthing on Linux
Syncthing is defined as a continuous file synchronization program: it can be used to keep files and directories synchronized across different devices or “nodes”. The application uses TLS as encryption method, and it is, together with its protocol, free and open source software. When using Syncthing, our data remains on our device, and is transferred directly to the destination without relaying on a central server (peer to peer). In this tutorial we will see how to install, configure and use Syncthing on Linux.
In this tutorial you will learn:
- How to install Syncthing on the most used Linux distributions
- How to setup the firewall for Syncthing to work correctly
- How to share and keep a directory synchronized across two devices
- How to austostart the Syncthing daemon automatically on user login
Linux Software Raid 1 Setup
RAID 1 is a hard disk configuration where the contents from one hard disk are mirrored onto another. This provides the user with some redundancy in case a disk fails. On your Linux system, the two hard drives are represented as a single file system. But in the background, making changes to your files is actually writing the changes to two disks at the same time. You can also add more than two disks to the configuration, as long as you keep the number even. Otherwise, something like RAID 5 will be more suitable.
There are many ways to configure a RAID setup. One of the easiest and most accessible ways is through the mdadm software package, which can be installed and used on any major Linux distribution. This is easier than some other RAID setups, since it doesn’t require any special hardware (like a RAID controller) and isn’t that hard to configure.
In this guide, we’ll go through the step by step instructions to install and setup mdadm on Linux, and create a RAID 1 configuration for two hard disks. Our example scenario will consist of two empty hard disks that are each 10 GB in size. This is in addition to our main hard disk, which is just used for the operating system.
Strictly speaking, RAID 1 is not a proper backup solution. It does provide some protection from disk failure, but what if you accidentally delete a file or a virus corrupts multiple files? Those undesirable changes are instantly written to both disks. RAID 1 provides high availability, but you shouldn’t use it as your only backup solution.
In this tutorial you will learn:
- How to install mdadm on major Linux distros
- How to partition hard disks for RAID setup
- How to create a new RAID device in mdadm and mount it
- How to keep the RAID array mount persistent
How to backup and restore permissions of the entire directory on Linux
The following two commands getfacl
and setfacl
are very handy tools as they allow Linux administrators to take a snapshot of any current permissions settings of any directory and if needed re-apply those permissions back recursively. Let’s have a look at the following example:
$ tree -p . ├── [dr---w----] dir1 │ └── [drwxr-xr-x] dir2 │ ├── [dr--r-xrw-] dir3 │ └── [---x--x--x] file1 ├── [drwxr-xr-x] dir4 │ └── [-rw-r--r--] file3 └── [-rwxrwxrwx] file2 4 directories, 3 files