Browse Source

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.
neels/inmarsat
Jan Luebbe 6 years ago
committed by Holger Hans Peter Freyther
parent
commit
f7b01afb65
  1. 20
      recipes-apps/sysmocom-backup/files/default.files
  2. 28
      recipes-apps/sysmocom-backup/files/sysmocom-backup
  3. 13
      recipes-apps/sysmocom-backup/sysmocom-backup_1.0.bb
  4. 3
      recipes-apps/tasks/task-sysmocom-tools.bb

20
recipes-apps/sysmocom-backup/files/default.files

@ -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

28
recipes-apps/sysmocom-backup/files/sysmocom-backup

@ -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"
}

13
recipes-apps/sysmocom-backup/sysmocom-backup_1.0.bb

@ -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
recipes-apps/tasks/task-sysmocom-tools.bb

@ -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…
Cancel
Save