# node-RED Backup Flow

**URL:** https://discourse.nodered.org/t/node-red-backup-flow/25033
**Category:** Share Your Projects
**Created:** [17 April 2020 20:52 UTC](https://discourse.nodered.org/t/node-red-backup-flow/25033 "2020-04-17T20:52:55Z")
**Posts on this page:** 1
**Showing post:** 7

<div class="post-metadata">

### Author: ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)
#### Post date: [6 July 2020 13:47 UTC](https://discourse.nodered.org/t/node-red-backup-flow/25033/7 "2020-07-06T13:47:59Z")

</div>

Just came here following the backup dicussion in another thread and decided to try it out on my win10 machine

It didn't work because win10 has no command line tool called zip

But it does have one called tar so I just did a simple mode of the dsm node and it works fine 🙂  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/7/0764fa3ef61bd80843e8e25619346e48f7b2a8ba.png)

here is the win10 alternative dsm node only

```auto
[{"id":"20a4ec54.6c6454","type":"dsm","z":"fa1b22c7.a8823","name":"backup","sm_config":"{\n \"currentState\": \"step1\",\n \"states\": {\n \"step1\": {\n \"start\": \"step2\",\n \"reset\": \"step1\"\n },\n \"step2\": {\n \"zip\": \"step3\",\n \"reset\": \"step1\"\n },\n \"step3\": {\n \"upload\": \"step1\",\n \"reset\": \"step1\"\n }\n },\n \"data\": {\n },\n \"methods\": {\n \"init\": [\n \"sm.udir = RED.settings.userDir + '/';\",\n \"sm.exec = require('child_process').exec;\",\n \"sm.hostname = require('os').hostname();\",\n \"sm.unlink = require('fs').unlink;\"\n],\n \"start\": [\n \"/* delete old zip file */\",\n \"var zipfile = sm.udir+'node-red.zip';\",\n \n \"sm.fill = 'grey';\",\n \"sm.text = 'deleting';\",\n \"output = false;\",\n\n \"sm.unlink(zipfile, function (err) {\",\n \" if (err) {\",\n \" node.warn('no file '+zipfile);\",\n \" }\",\n \" resume('zip', msg);\",\n \"});\"\n],\n \"zip\": [\n \"var pre = ' ' + sm.udir;\",\n \"var cmd = 'tar.exe -a -c -f';\",\n \"cmd += pre + 'node-red.zip';\",\n \"cmd += pre + 'flows*.json';\",\n \"cmd += pre + '.config.json';\",\n \"cmd += pre + '.sessions.json';\",\n \"cmd += pre + 'settings.js';\",\n \"cmd += pre + 'package.json';\",\n \"cmd += pre + 'package-lock.json';\",\n \"cmd += pre + 'lib/*';\",\n\n \"sm.fill = 'grey';\",\n \"sm.text = 'zipping';\",\n \"output = false;\",\n \n \"sm.exec(cmd, function(error, stdout, stderr) {\",\n \" if (error) {\",\n \" node.warn(error);\",\n \" } else {\",\n \" resume('upload', msg);\",\n \" }\",\n \"});\"\n],\n \"upload\": [\n \"sm.ts = new Date();\",\n \"sm.days = ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'];\",\n \"sm.day = sm.days[sm.ts.getDay()];\",\n \"msg.filename = sm.day + '_nodered.zip';\",\n \"msg.localFilename = sm.udir+'node-red.zip';\",\n \"sm.fill = 'green';\",\n \"sm.text = sm.day;\"\n ],\n \"reset\": [\n \"sm.fill = 'grey';\",\n \"sm.text = 'reset';\",\n \"output = false;\"\n],\n \"status\": {\n \"fill\": {\n \"get\": \"sm.fill\"\n },\n \"shape\": \"dot\",\n \"text\": {\n \"get\": \"sm.text\"\n }\n }\n }\n}","x":355,"y":160,"wires":[["44702648.1f2418"]]}]

```

---

_[View the full topic](https://discourse.nodered.org/t/node-red-backup-flow/25033)._
