Automatic backup on Linux: Easy autonomous, secure, distributed network backup

Source: Internet
Author: User

The loss of important data can mean fatal damage. Still, countless professionals are ignoring the backup of their data. Although the reasons may vary, one of the most common explanations is that performing routine backups is really cumbersome. Because machines are adept at accomplishing common and repetitive tasks, automating the backup process is key to reducing the intrinsic tedium of work and the propensity for procrastination that people are born with.

If you use Linux, you can already use extremely powerful tools that create customized backup solutions. The scenarios in this article allow you to perform a simple to more advanced and secure network backup with an open source tool that comes with almost every Linux release.

Simple backup

This article is described in a step-by-step way, and this approach is straightforward as long as you follow those basic steps.

Before we look at more advanced distributed backup solutions, let's start with a simple and powerful archiving mechanism. Let's analyze a handy script called arc, which allows us to create a backup snapshot in the Linux shell prompt.

Listing 1. Arc Shell Script

#!/bin/sh
tar czvf $1.$ (date +%y%m%d%-h%m%s). tgz
$?

The arc script receives a separate file or directory name as a parameter, creates a compressed archive file, and embeds the current date into the name of the generated archive file. For example, if you have a directory named Beoserver, you can call the Arc script and pass the Beoserver directory name to it to create a compressed archive file, such as: beoserver.20040321-014844.tgz

The date command is used to embed a date and time stamp to help you organize your archived files. Dates are in the format of year, month, day, hour, minute, and second-although there is some redundancy in the use of the second field. Look at the manual for the data Command (man date) for additional options. In addition, in Listing 1, we passed the-V (verbose) option to tar. This allows tar to display the files it is archiving. If you prefer to make backups silently, delete this-v option.

Listing 2. Archive Beoserver Directory

$ ls
arc beoserver
$./arc beoserver
beoserver/
beoserver/bookl.dat
beoserver/beoserver_ab_o FF
beoserver/beoserver_ab_on
$ ls
arc beoserver beoserver.20040321-014844.tgz

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.