n6vmo
Posts: 25
Joined: Fri May 10, 2013 9:55 pm

Need this to run at boot.....

Wed May 17, 2017 6:42 am

I need this 'netcat' command to run at boot:

nc 192.168.xxx.xxx 30002 | nc 192.168.xxx.xxx 30001

Both these RPi's are located on remote mountain tops. I need to get it right and not lock anything up, or it is a long trip to correct it.

Thanks,

John

User avatar
RaTTuS
Posts: 10559
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK
Contact: Twitter YouTube

Re: Need this to run at boot.....

Wed May 17, 2017 6:55 am

are these running jessie ?
if so write a systemd.service

if you want to do a quick hack then stuff the commands into /etc/rc.local [this is not the way to do it as you will get issues]
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

Tdi-Me
Posts: 38
Joined: Fri May 05, 2017 8:11 pm

Re: Need this to run at boot.....

Wed May 17, 2017 4:43 pm

would this also be how to create a start up script to mount a usb hard drive?
I know i can modify fstab, but i screwed up once already and i would prefer to not do that again if possible :) making a script that runs at startup seems like a very friendly way to do it that wont muck up the system being able to start if i flub a command. ( ok so its more like when i flub a command since its me lol )

User avatar
RaTTuS
Posts: 10559
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK
Contact: Twitter YouTube

Re: Need this to run at boot.....

Thu May 18, 2017 6:29 am

this is really a different question to the OP
if the USB drive is permanently plugged in then fstab is the way to do it
if the drive is plugged in and out then a udev rule is what you need
in either case ask in another thread - post a link to it if you wish
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

n6vmo
Posts: 25
Joined: Fri May 10, 2013 9:55 pm

Re: Need this to run at boot.....

Thu May 18, 2017 10:00 am

RaTTuS wrote:are these running jessie ?
if so write a systemd.service

if you want to do a quick hack then stuff the commands into /etc/rc.local [this is not the way to do it as you will get issues]
Yes, both of these machines are running jessie. I am looking into writing a systemd.service.

Return to “Beginners”