📜 ⬆️ ⬇️

Setting up a Linux server backup in 5 minutes

Before me it became necessary to set up a backup on a new Linux server, this task is very important, but painfully boring: you need to write and debug scripts that will archive the necessary folders (and it is desirable to make incremental archives), databases, subversion repositories, and then transfer these archives to a remote server. That's why I tried to google a ready-made solution for this task and as a result I came across a backup-manager , a wonderful open source set of bash scripts that allow:
Thus, this one set of scripts solved absolutely all my backup tasks. All this economy is configured in no more than five minutes, since in the configuration file each parameter has detailed comments, so no one should have problems with the settings.

You can download it from here: www.backup-manager.org/downloads , or you can simply install the backup-manager package (example for Debian):

aptitude install backup-manager

In addition, you need to take into account that in order to copy data to the Amazon S3 repository, the libnet-amazon-s3-perl and libfile-slurp-perl packages must be installed on the system:

aptitude install libnet-amazon-s3-perl libfile-slurp-perl

Now it remains only to configure the start-up backup-manager on the krone and you can sleep peacefully.
')
Upd.
All settings are stored in the /etc/backup-manager.conf file, here are its main parameters:

# ,
export BM_REPOSITORY_ROOT="/var/archives"

#
export BM_ARCHIVE_METHOD="tarball-incremental mysql svn"

#
# ,
BM_TARBALL_TARGETS[0]="/etc"
BM_TARBALL_TARGETS[1]="/boot"
BM_TARBALL_TARGETS[2]="/var/www"
export BM_TARBALL_TARGETS

# , ,
export BM_TARBALL_BLACKLIST="/dev /sys /proc /tmp *imagecache*"

# -
export BM_TARBALLINC_MASTERDATETYPE="weekly"
export BM_TARBALLINC_MASTERDATEVALUE="1"

# MySQL mysql-
export BM_MYSQL_DATABASES="__ALL__"
export BM_MYSQL_ADMINLOGIN="user"
export BM_MYSQL_ADMINPASS="1234"

# subversion-
export BM_SVN_REPOSITORIES="/var/repositories"

#
# ( ftp, ssh, ssh-gpg, rsync)
export BM_UPLOAD_METHOD="s3"

# Amazon S3 , access key secret key
export BM_UPLOAD_S3_DESTINATION="basket-name"
export BM_UPLOAD_S3_ACCESS_KEY="ABC123"
export BM_UPLOAD_S3_SECRET_KEY="DEF456"


These are the most basic settings, in the config itself there are a couple of dozen of parameters, all of which are commented in detail.

Source: https://habr.com/ru/post/87435/


All Articles