Simple full backup complete IOT database

 

Script for backup to mounted NAS directory

#!/bin/bash
set -x
#
# (c) DL2SBA 25.08.2018
#
# Mount the network share
#
MOUNT_SOURCE="//<ipadr>/backup"
MOUNT_TARGET="/mnt/backup"
MOUNT_USER="<user>"
MOUNT_PASSWD="<pass>"
mount -v -t cifs -o user=$MOUNT_USER,password=$MOUNT_PASSWD,rw,file_mode=0777,dir_mode=0777,uid=$MOUNT_USER,gid=users $MOUNT_SOURCE $MOUNT_TARGET

#
# backup the influx database IOT
#
TARGETDIR=$MOUNT_TARGET/INFLUX/` date +%Y%m%d_%H%M%S`
influxd backup $TARGETDIR
influxd backup -database "iot" $TARGETDIR

#
# Unmount the network share
#
umount -v /mnt/backup

Daily backup

Add this line to the crontab of root

0 5 * * * /home/dietmar/bin/backupInflux.sh  | /usr/bin/logger -t influxbackup

 

 

 

2014 CW (Morse Telegraphy) was added to the German Nationwide Inventory of Intangible Cultural Heritage.

Logo