1. Скопировать файл /data/agis/agis-script/agis_backup_lvm_xfs.v2 в /data/script
$ cp /data/agis/agis-script/agis_backup_lvm_xfs.v2 /data/script
2. Создать файл /data/script/agis_backup_list.txt со следующим содержанием. Подробно смотреть тут
$ cat /data/script/agis_backup_list.txt agis:agis
# Thi script is written for automaticly backup directories from LVM (XFS) file systems
# For example shapshot generates like this
# lvcreate -L100G -p rw -s -n lv_agis_snap /dev/vg/lv1
# lvremove -f vg/lv_agis_snap
#
# Path of bacup direcory of Billing system
# /data/docker/billing-prod-srvkzowc-kzowc-mongo/data
# /data – mount point to LV disk
# Line in config file have to be:
# Billing:docker/billing-prod-srvkzowc-kzowc-mongo/data
#
# Crontab record
# 0 1 * * * root /data/script/agis_backup_lvm_xfs
# Do not forget to restart cron after changes
# systemctl restart cron
#Settings
VOLGROP=’vg’ # name of the volume group
ORIGVOL=’lv1′ # name of the logical volume to backup
SNAPVOL=’lv_agis_snap’ # name of the snapshot to create
MNTDIR=’/mnt’ # name of the temporary directory to mount
BACKUPDIR=’/data/backup/day’ # name of the directory where backup have to save
TEMP_BACKUPDIR=’/backup’ # name of the directory where temporary backup have to save
LOGFILE=’/var/log/agis_backup.log’ # name of the log file
SNAPSIZ=’100G’ # space to allocate for the snapshot in the volume group
FILELIST=”/data/script/agis_backup_list.txt” # config file contains list of service and directories to backup