# Exec Node - How to

**URL:** https://discourse.nodered.org/t/exec-node-how-to/55530
**Category:** General
**Created:** [21 December 2021 16:12 UTC](https://discourse.nodered.org/t/exec-node-how-to/55530 "2021-12-21T16:12:27Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![JoseGodinho](https://avatars.discourse-cdn.com/v4/letter/j/f4b2a3/32.png) [@JoseGodinho](https://discourse.nodered.org/u/JoseGodinho)
#### Post date: [21 December 2021 16:12 UTC](https://discourse.nodered.org/t/exec-node-how-to/55530/1 "2021-12-21T16:12:27Z")

</div>

hello  
I would apreciate the support how to run this sett of linux/raspbian commands. ( using exec node?) if so how?

```auto
# Stop Zigbee2MQTT and go to directory
sudo systemctl stop zigbee2mqtt
cd /opt/zigbee2mqtt

# Backup configuration
cp -R data data-backup

# Update
git checkout HEAD -- npm-shrinkwrap.json
git fetch
git checkout dev # Change 'dev' to 'master' to switch back to the release version
git pull
npm ci

# Restore configuration
cp -R data-backup/* data
rm -rf data-backup

# Start Zigbee2MQTT
sudo systemctl start zigbee2mqtt

```

---

<div class="post-metadata">

### Author: ![hardillb](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hardillb/32/12373_2.png) [@hardillb](https://discourse.nodered.org/u/hardillb)
#### Post date: [21 December 2021 16:16 UTC](https://discourse.nodered.org/t/exec-node-how-to/55530/2 "2021-12-21T16:16:18Z")

</div>

1. Add the commands to a shell script
2. Call the shell script from the exec node

---

<div class="post-metadata">

### Author: ![JoseGodinho](https://avatars.discourse-cdn.com/v4/letter/j/f4b2a3/32.png) [@JoseGodinho](https://discourse.nodered.org/u/JoseGodinho)
#### Post date: [21 December 2021 16:19 UTC](https://discourse.nodered.org/t/exec-node-how-to/55530/3 "2021-12-21T16:19:20Z")

</div>

Thank you, I woll investigate this shell script

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [21 December 2021 17:00 UTC](https://discourse.nodered.org/t/exec-node-how-to/55530/4 "2021-12-21T17:00:17Z")

</div>

In addition you will have to allow the user that is running node red to perform those sudo commands without having to provide a password (as you cannot provide a password via the exec node). You can do that using `sudo visudo`.

---

<div class="post-metadata">

### Author: ![JoseGodinho](https://avatars.discourse-cdn.com/v4/letter/j/f4b2a3/32.png) [@JoseGodinho](https://discourse.nodered.org/u/JoseGodinho)
#### Post date: [21 December 2021 22:26 UTC](https://discourse.nodered.org/t/exec-node-how-to/55530/5 "2021-12-21T22:26:10Z")

</div>

Done  
Thank you

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [19 February 2022 22:26 UTC](https://discourse.nodered.org/t/exec-node-how-to/55530/6 "2022-02-19T22:26:50Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
