I am working on a Raspberry Pi project; it includes NUT server configuration and making the OS Image read-only.

I have completed the required steps and configured the NUT server.

I uninstalled the cron and required a alternate method to launch my application script on start up. after looking up some online resources, I have decided to use the rc.local file to launch my application script.

But when the system reboots I am seeing the my application script is continuously displaying the message generate by the NUT server command. Which used to be not visible when I was using the cron.

The following is the command that is generating a message every time the script is called. (My application script runs in a infinite loop).


upsc myups


Init SSL without certificate database

I have tried dumping the script output to /dev/null but it did not help.


printf "Launching Script \n"

/home/pi/dataLog.sh & > /dev/null  2>&1

I am not sure if this is the right approach.

  • I have my script at /home/pi/ directory. – Kunal Sonone Sep 16 '19 at 18:14
  • I have tried the method shown in the link, still getting the message Using following - /home/pi/dataLog.sh & > /dev/null 2>&1 – Kunal Sonone Sep 16 '19 at 18:16
  • @Christopher - I have used the /etc/home/pi/<script> but now I am getting error that file not found. – Kunal Sonone Sep 16 '19 at 18:19
  • 3
    command > /dev/null 2>&1 & – Christopher Sep 16 '19 at 18:31
  • 1
    Why the & before the > /dev/null ? – Scottie H Sep 16 '19 at 18:41

Thank you, Christopher for the answer. The right method is

/home/pi/script > /dev/null 2>&1 & 
| improve this answer | |
  • 1
    @ Anthony Geoghegan There is 2 day wait time before I can accept my answer – Kunal Sonone Sep 17 '19 at 14:35
  • 1
    OK, that makes sense. I don't ask many questions here but when I do I'm usually happy to wait a while for the best answer so I wasn't aware of this delay. BTW, I'd suggest that whenever you're writing shell scripts, it's always worth checking them with shellcheck. – Anthony Geoghegan Sep 18 '19 at 9:13
  • @AnthonyGeoghegan thank you for the information, I was not aware about this tool. – Kunal Sonone Sep 18 '19 at 12:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.