How to easily convert to double matlab

ubuntuusers.de

Jon75

Registration date:
August 16, 2017

Posts: Count ...

August 16, 2017 12:00 PM

Hi folks, I need a little help here: Via wget I get a picture from an IP camera and now I want to save it in 2 different places at the same time. Can I do that with a single command or do I have to execute the save command for the 2 locations individually?

Thanks in advance for your help.

Lg Stefan

frost protection

Registration date:
November 18, 2010

Posts: 7161

August 16, 2017 12:10 PM

wget to / tmp and then cp twice to your destinations would be the normal approach.

Something like that also works, but there is no check whether these files exist, which timestamps they should have, etc.

The naive approach is better (why does everything always have to be a single command?) As long as you don't have a good reason to object.

rklm

Registration date:
October 16, 2011

Posts: 11406

August 16, 2017 12:16 PM

frost protection record:

wget to / tmp and then cp twice to your destinations would be the normal approach.

That creates unnecessary copying. I would take it by the way. Simply download it to one place and then copy it to the other.

frost protection

Registration date:
November 18, 2010

Posts: 7161

August 16, 2017 1:11 PM

rklm wrote:

Simply download it to one place and then copy it to the other.

Sure, it works too. But you may want to check that you have downloaded a complete file first before distributing it further; or there are special cases, e.g. if the destination is also a network drive again, then you have an up / download again. So the idea of ​​throwing it first locally in / tmp / (then with or similar), you have to clean that up again.

Jon75

Registration date:
August 16, 2017

Posts: 3

August 16, 2017 2:37 PM

Hi, thanks for your replies!

I now save the file and then copy it to the 2nd storage location via cp. The whole script runs on a Raspberry and I don't want to cache it on the internal SD card. The Raspberry should run like this for about a year and is not really easy to reach. If I were to temporarily store on the SD card, it will certainly be defective due to the many write cycles.

frost protection

Registration date:
November 18, 2010

Posts: 7161

August 16, 2017 3:01 PM

Jon75 wrote:

The whole script runs on a Raspberry and I don't want to cache it on the internal SD card.

Isn't / tmp a tmpfs in RAM anyway? How big are the files? You only need space for one (if you tidy up well).

If the Raspi itself does not save anything, it is as I suspected, you download it from A and then upload it to B and C. And depending on how B is connected, you download it again from B to be able to upload it to C. You can keep it in the RAM or just continue to muddle with tea.

Jon75

Registration date:
16th August 2017

Posts: 3

August 16, 2017 3:14 PM

Data carrier 1 is an HDD that is connected via USB. The whole thing tightly packed in a water and dust-proof housing. All recordings are saved here. Data carrier 2 is a USB stick that is also attached to the Raspy via an external USB socket in the housing. The housing is and remains closed, the user now only picks up and down the stick and swaps it for another or copies the stick, empties it and puts it back into the housing.

sebix

Registration date:
April 14, 2009

Posts: 4409

August 16, 2017 8:53 PM

Can you show the issue of? This indicates whether / tmp is a tmpfs, as antifreeze suspects.