This is the new version of my old website. You can find the old website here: old.dl2sba.com. If you miss any information or you find bugs, please let me know by E-Mail

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
#
# uncomment for verbose output
#
# set -x
#
# (c) DL2SBA 27.10.2018
#
#
echo "-------------------- starting node red backup ---------------"
# MOUNT_SOURCE="//ds213/backup"
MOUNT_TARGET="/mnt/backup"
MOUNT_USER="USER"
MOUNT_PASSWD="PASS"
NODE_RED_ROOT=/home/nodered
NODE_RED_FOLDER=myNodeRed
TARGET_DIR=$MOUNT_TARGET/Nodes/node-red/NODE-RED
TARGET_FILE=$TARGEt_DIR/node-red.` date +%Y%m%d_%H%M%S`.tar.gz

#
# check for mounted backup directory
#
if [ -d "$MOUNT_DIR" ]; then
echo "--- mounting ..."
# Mount the network share
#
mount -v -t cifs -o user=$MOUNT_USER,password=$MOUNT_PASSWD,rw,file_mode=0777,dir_mode=0777,uid=$MOUNT_USER,gid=users,vers=2.0 $MOUNT_SOURCE $MOUNT_TARGET
#
echo "--- mounted"
fi

#
# backup node-red data
#
cd $NODE_RED_ROOT
tar -cvzf $TARGET_FILE --exclude="$NODE_RED_FOLDER/node_modules" $NODE_RED_FOLDER
#
echo "-------------------- node red backup DONE ---------------"

 

 

 

Daily backup

Add this line to the crontab of root

sudo crontab -u root -e
10 5 * * * /home/nodered/backupNodeRed.sh  | /usr/bin/logger -t noderedbackup
(c) Dietmar Krause, DL2SBA 2026 Impressum Datenschutz
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Marketing
Set of techniques which have for object the commercial strategy and in particular the market study.
Quantcast
Save