Skip to content

Instantly share code, notes, and snippets.

Forked from fragolinux/
Last active April 30, 2018 06:53
What would you like to do?
simple but effective node-red setup backup script
# useful vars
DATE=$(date +"%Y%m%d%H%M")
# create dated backup folders
mkdir -p $WHERE/{sqlite,nodered,etc}
# safely backup sqlite db
# sqlite3 ~/dbs/iot.db ".backup $WHERE/sqlite/iot.db"
# backup json and js files
cp -a ~/.node-red/{*.json,*.js,public,lib,.config.json} $WHERE/nodered
# backup main config folders/files
sudo cp -a /etc/{mosquitto,hosts,hostname,rc.local,nginx} $WHERE/etc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment