-
-
Save marciogranzotto/729dfde81a2a8d01af6d25bb7c2b887d to your computer and use it in GitHub Desktop.
simple but effective node-red setup backup script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cd | |
# useful vars | |
DATE=$(date +"%Y%m%d%H%M") | |
WHERE=~/backup/$DATE | |
# 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