sysmocom-backup: make file list configurable
Move the default file list to a separate file in /etc/sysmocom/backup.d, which is itself included in the backup. Also create a symlink to the most recent backup.
This commit is contained in:
parent
17a8ba8c03
commit
f7b01afb65
|
@ -0,0 +1,20 @@
|
|||
etc/hostname
|
||||
etc/ifplugd.sh
|
||||
etc/network/interfaces
|
||||
etc/openvpn
|
||||
etc/opkg/sysmocom-config.conf
|
||||
etc/osmocom/osmo-bsc-mgcp.cfg
|
||||
etc/osmocom/osmo-bsc.cfg
|
||||
etc/osmocom/osmo-bts.cfg
|
||||
etc/osmocom/osmo-nitb.cfg
|
||||
etc/osmocom/osmo-pcu.cfg
|
||||
etc/osmocom/osmo-sgsn.cfg
|
||||
etc/systemd/system/multi-user.target.wants/osmo-nitb.service
|
||||
etc/systemd/system/multi-user.target.wants/osmo-bsc.service
|
||||
etc/systemd/system/multi-user.target.wants/osmo-sgsn.service
|
||||
etc/ggsn.conf
|
||||
etc/default
|
||||
var/lib/osmocom/hlr.sqlite3
|
||||
etc/lcr
|
||||
etc/udhcpd.conf
|
||||
etc/sysmocom/backup.d
|
|
@ -3,28 +3,7 @@
|
|||
|
||||
# Make sure to look at sysmocom-restore to check if the file would
|
||||
# be restored right. Currently only some dirs get restored.
|
||||
FILES="\
|
||||
etc/hostname \
|
||||
etc/ifplugd.sh \
|
||||
etc/network/interfaces \
|
||||
etc/openvpn \
|
||||
etc/opkg/sysmocom-config.conf \
|
||||
etc/osmocom/osmo-bsc-mgcp.cfg \
|
||||
etc/osmocom/osmo-bsc.cfg \
|
||||
etc/osmocom/osmo-bts.cfg \
|
||||
etc/osmocom/osmo-nitb.cfg \
|
||||
etc/osmocom/osmo-pcu.cfg \
|
||||
etc/osmocom/osmo-sgsn.cfg \
|
||||
etc/systemd/system/multi-user.target.wants/osmo-nitb.service \
|
||||
etc/systemd/system/multi-user.target.wants/osmo-bsc.service \
|
||||
etc/systemd/system/multi-user.target.wants/osmo-sgsn.service \
|
||||
etc/ggsn.conf \
|
||||
etc/default \
|
||||
var/lib/osmocom/hlr.sqlite3 \
|
||||
etc/lcr \
|
||||
etc/udhcpd.conf \
|
||||
etc/sysmocom/backup.d \
|
||||
"
|
||||
FILES="etc/sysmocom/backup.d"
|
||||
|
||||
# Pick some extra files
|
||||
if [ -e /etc/sysmocom/backup.d/ ]; then
|
||||
|
@ -67,7 +46,10 @@ do_backup_files() {
|
|||
# 4. Add the more information
|
||||
tar -rf $BACKUP_FILE --transform='s,^,info/,' -C $NAME installed_packages mac_addr
|
||||
|
||||
# 5.
|
||||
# 5. Create stable link
|
||||
ln -sf $BACKUP_FILE /home/root/sysmocom-backup.tar
|
||||
|
||||
# 6.
|
||||
echo "The backup was stored to $BACKUP_FILE"
|
||||
}
|
||||
|
||||
|
|
|
@ -3,11 +3,22 @@ LICENSE = "GPLv3+"
|
|||
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
|
||||
PR = "r12"
|
||||
|
||||
SRC_URI = "file://sysmocom-backup file://sysmocom-restore"
|
||||
SRC_URI = " \
|
||||
file://sysmocom-backup \
|
||||
file://sysmocom-restore \
|
||||
file://default.files \
|
||||
"
|
||||
RDEPENDS_${PN} = "tar"
|
||||
|
||||
do_install() {
|
||||
install -d ${D}${sbindir}
|
||||
install -m 0755 ${WORKDIR}/sysmocom-backup ${D}${sbindir}/
|
||||
install -m 0755 ${WORKDIR}/sysmocom-restore ${D}${sbindir}/
|
||||
|
||||
install -d ${D}${sysconfdir}/sysmocom/backup.d
|
||||
install -m 0644 ${WORKDIR}/default.files ${D}${sysconfdir}/sysmocom/backup.d/
|
||||
}
|
||||
|
||||
PACKAGES =+ "${PN}-default"
|
||||
|
||||
FILES_${PN}-default = "${sysconfdir}/sysmocom/backup.d/"
|
||||
|
|
|
@ -3,7 +3,7 @@ LICENSE = "MIT"
|
|||
LIC_FILES_CHKSUM = " \
|
||||
file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
|
||||
ALLOW_EMPTY_${PN} = "1"
|
||||
PR = "r7"
|
||||
PR = "r9"
|
||||
|
||||
RDEPENDS_${PN} = "\
|
||||
lmsensors-scripts \
|
||||
|
@ -15,4 +15,5 @@ RDEPENDS_${PN} = "\
|
|||
wget \
|
||||
ca-cacert-rootcert \
|
||||
sysmocom-backup \
|
||||
sysmocom-backup-default \
|
||||
"
|
||||
|
|
Loading…
Reference in New Issue