To do so, we will create a mount point called /backup as follows. Next, we are going to mount it back so the Linux system can detect it. Once unmounted, format the external drive to ext4 filesystem using the mkfs command as follows: To achieve this, we will first unmount it. To use the USB drive as a backup destination, we need to format it to the ext4 filesystem. In the output, we can see it is labelled sdb.The complete SCSI ID for the device is /dev/sdb/ and it is currently mounted on the /media/jumpcloud/USB mount point. This can be done with different external devices as well. Unmount, Format, and Remount the External Deviceįirst, insert your external USB drive and take note of its SCSI ID. Keep reading to learn how to make a local backup. You can also learn how to back up your system to another remote Linux system if you’d prefer in a different tutorial. In this section, we are going to demonstrate how you can back up your system on an external drive. Better yet, you can automate the backups using shell scripts and cron jobs. It allows you to make incremental backups including the entire directory tree, both locally and on a remote server. The rsync command-line tool is the most preferred backup tool in Linux systems for multiple reasons. How to Make a Local Backup Using the Rsync Toolĭisclaimer: This method is recommended for standalone systems that are not accessed by other users or processes in the network since some data will constantly change with each passing minute and interfere with the backup process. Now that you have a basic understanding of how rsync works, let’s now switch gears and explore how you can back up and restore a Linux system using the utility. ![]() The -v option prints out the syncing process in verbose. Without the trailing slash, the entire mydir1 directory would be placed into mydir2 directory. In both commands, there is a trailing slash ( /) after the first argument - which is mydir1.This specifies that only the contents of the directory, and not the directory itself in its entirety, is to be copied. In most cases, this option is preferred to the -r option. This option not only syncs recursively, but also preserves attributes such as symbolic links, file ownerships, permissions, and modification times. This implies that it takes into consideration all of the directory’s contents.Īdditionally, you could use the -a option instead. ![]() Next, we will sync all the files in mydir1 directory to mydir2 as follows. To confirm the files exist, we will run the command: Next, we are going to create a few text files in the first directory. To demonstrate how rsync works, we will start by creating two separate directories: The rsync syntax is pretty straightforward and quite similar to the cp or the scp (secure copy). We will demonstrate how you can back up your Linux system on an external drive. In this guide, we explore how you can back up and restore your Linux system using the rsync utility. It’s an incremental backup tool that saves your time when huge backups are involved. It compares the source and destination location and only transfers the portions of data that have changed. ![]() The rsync tool, short for remote sync, is a file synchronization tool that intelligently backs up data locally or remotely. One of the handiest and reliable backup tools you can use to back up your server is the rsync utility. Alternatively, you could manually back up your server to an external hard drive, RAID array, or another remote server. You could use a backup software that automatically backs up your system at predefined times. There are multiple backup solutions available to Linux users. Backups should always be encrypted and have the appropriate physical security controls in place for access if they are stored on premises. In addition to restoring from a major failure or attack, backups can save you time when you want to migrate data from one Linux system to another. Like brushing your teeth, backing up your server regularly is an essential task that every Linux user should undertake. Like many other areas of management, Linux operating systems have more options, but require more knowledge to set them up successfully. However, each operating system has a different way to handle this, and while some provide built-in utilities to accomplish this, others must be established from the ground up. Server backups provide the much-needed confidence that data is not lost and can be recovered in case of any eventuality. Your ability to recover will only be as good as your last backup. This can potentially paralyze your business through the loss of vital records such as financial and customer data. It’s easy to take for granted the importance of having a server backup - until you experience a system failure, a natural disaster, or a malware attack.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |