# Send images from machine A to machine B

**URL:** <https://discourse.nodered.org/t/send-images-from-machine-a-to-machine-b/25391>\
**Category:** General\
**Created:** [24 April 2020 02:15 UTC](https://discourse.nodered.org/t/send-images-from-machine-a-to-machine-b/25391 "2020-04-24T02:15:24Z")\
**Posts on this page:** 4\
**Page:** 2

<div class="post-metadata">

**Author:** ![rrl.raoni](https://avatars.discourse-cdn.com/v4/letter/r/7c8e57/32.png) [@rrl.raoni](https://discourse.nodered.org/u/rrl.raoni)\
**Post date:** [27 April 2020 00:32 UTC](https://discourse.nodered.org/t/send-images-from-machine-a-to-machine-b/25391/21 "2020-04-27T00:32:40Z")

</div>

Colin,

Sorry me... while I asked I was researching about the application, and I thought that I could improve my question, sorry.

I think the best think to do is close this topic and begin a new one, right?

I really loved the application that @BartButenaers showed me.

thak you Colin and thank you for all your help!

---

<div class="post-metadata">

**Author:** ![rrl.raoni](https://avatars.discourse-cdn.com/v4/letter/r/7c8e57/32.png) [@rrl.raoni](https://discourse.nodered.org/u/rrl.raoni)\
**Post date:** [27 April 2020 00:37 UTC](https://discourse.nodered.org/t/send-images-from-machine-a-to-machine-b/25391/22 "2020-04-27T00:37:06Z")

</div>

Yes, it is possible, but look:

I want to do that my suplier see the data that I'm seeing - I don't want to have mismatch of information (it could happen using the same datas in two differents systems).

Thank you Steve. I really appreciate your attention and information!

---

<div class="post-metadata">

**Author:** ![WillWelker](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/willwelker/32/771_2.png) [@WillWelker](https://discourse.nodered.org/u/WillWelker)\
**Post date:** [27 April 2020 14:29 UTC](https://discourse.nodered.org/t/send-images-from-machine-a-to-machine-b/25391/23 "2020-04-27T14:29:15Z")

</div>

Just my 2 cents here: I have moved files very easily between Linux machines (Raspberry Pis and Ubuntu etc) using and exec node to scp with ssh. I use this to pull video and picture files from security cams made from Pi computers.  
The command entered into the exec node looks something like this"

```auto
scp pi@192.168.1.122:/var/lib/motion/* /home/will/.node-red/static/motion/storage/

```

More details if you are not familiar with ssh shell commands:  
Basically scp is the same as the cp (copy) command. Think of it as ssh-copy.  
The above command is run on my Ubuntu 'server' machine and retrieves files from a pi camera.  
You need ssh working on both machines and the server needs to have a key copied to the Pi so you can run without password. To do this, run the following terminal command on the machine that will be running the scp command:

```auto
# you only need keygen if you have never done it before on this machine
ssh-keygen
# copy id to other machine
ssh-copy-id pi@192.168.1.122

```

Now you can run ssh without a password.  
Also you can run more complex operations by using the exec node to run a shell script like this:

```auto
#!/bin/bash

today=`date +%Y-%m-%d.%H:%M:%S`

# $1 first imput parameter will be day of month 1-31
# $2 second imput parameter will be the last IP address number 192.168.1.XXX 0-255

# the -p parameter makes directories and subdirectories if they do not exist
mkdir -p /home/will/.node-red/static/motion/$1/$2

#ssh pi@192.168.1.204 "sudo dd if=/etc/motion/motion.conf bs=1M" | dd of=backup-motion.conf
# remove old files
rm /home/will/.node-red/static/motion/$1/$2/*

echo getting files from pi
scp pi@192.168.1.$2:/var/lib/motion/* /home/will/.node-red/static/motion/$1/$2/

# count files moved to new location
# output will be in msg.payload from the exec node
ls /home/will/.node-red/static/motion/$1/$2 -1 | wc -l

```

---

<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:** [11 May 2020 14:29 UTC](https://discourse.nodered.org/t/send-images-from-machine-a-to-machine-b/25391/24 "2020-05-11T14:29:16Z")

</div>

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

[Previous page](https://discourse.nodered.org/t/send-images-from-machine-a-to-machine-b/25391.md?page=1)
