According to node-red cookbook all files in the .node-red subdirectory should be backuped - except files in "node-modules" sub-directory:

 

I made a short script to backup the relevant files:

#!/bin/bash
set -x
#
# (c) DL2SBA 25.08.2018
#
# Mount the network share
#
MOUNT_SOURCE="//<ip-adr>/backup"
MOUNT_TARGET="/mnt/backup"
MOUNT_USER="<user>"
MOUNT_PASSWD="<password>"
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 node-red data
#
NODE_RED_ROOT=/home/dietmar/.node-red
TARGET_FILE=$MOUNT_TARGET/NODE-RED/node-red.` date +%Y%m%d_%H%M%S`.tar.gz
cd $NODE_RED_ROOT
tar -cvzf $TARGET_FILE `find . -path ./node_modules -prune -o -type f -print`

#
# unmount network share
#
umount -v /mnt/backup

 

Daily backup

Add this line to the crontab of root

10 5 * * * /home/dietmar/bin/backupNodeRed.sh  | /usr/bin/logger -t noderedbackup

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

Logo