{"id":311,"date":"2021-06-11T08:09:02","date_gmt":"2021-06-11T08:09:02","guid":{"rendered":"https:\/\/tomtechproductions.be\/?p=311"},"modified":"2021-06-11T08:09:02","modified_gmt":"2021-06-11T08:09:02","slug":"autostart-script-linux","status":"publish","type":"post","link":"https:\/\/blog.tomtechproductions.be\/index.php\/2021\/06\/11\/autostart-script-linux\/","title":{"rendered":"Autostart script linux"},"content":{"rendered":"\n<p>Maak een script aan&nbsp;<strong>sudo nano start.sh<\/strong><\/p>\n\n\n\n<p><strong>#!\/bin\/sh<br>sleep 10<br>cd \/<br>cd home\/pi\/<br>sudo python ip.py &amp;<br>cd \/<br><\/strong><br>Wijzig de rechten&nbsp;<strong>sudo chmod 775 start.sh<\/strong><\/p>\n\n\n\n<p><strong>sudo crontab -e<\/strong><br>Voeg volgende lijn toe&nbsp;<strong>@reboot sudo sh \/home\/pi\/start.sh &gt;\/home\/pi\/logs\/cronlog 2&gt;&amp;1<\/strong><\/p>\n\n\n\n<p>Maak een log file<br><strong>mkdir logs<br>chmod 775 logs<br><br><a href=\"https:\/\/stackoverflow.com\/questions\/24518522\/run-python-script-at-startup-in-ubuntu\">Ubuntu opstartscript<\/a><\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Maak een script aan&nbsp;sudo nano start.sh #!\/bin\/shsleep 10cd \/cd home\/pi\/sudo python ip.py &amp;cd \/Wijzig de rechten&nbsp;sudo chmod 775 start.sh sudo crontab -eVoeg volgende lijn toe&nbsp;@reboot sudo sh \/home\/pi\/start.sh &gt;\/home\/pi\/logs\/cronlog 2&gt;&amp;1 Maak een log filemkdir logschmod 775 logs Ubuntu opstartscript<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-311","post","type-post","status-publish","format-standard","hentry","category-geen-categorie"],"_links":{"self":[{"href":"https:\/\/blog.tomtechproductions.be\/index.php\/wp-json\/wp\/v2\/posts\/311","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.tomtechproductions.be\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.tomtechproductions.be\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.tomtechproductions.be\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.tomtechproductions.be\/index.php\/wp-json\/wp\/v2\/comments?post=311"}],"version-history":[{"count":0,"href":"https:\/\/blog.tomtechproductions.be\/index.php\/wp-json\/wp\/v2\/posts\/311\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.tomtechproductions.be\/index.php\/wp-json\/wp\/v2\/media?parent=311"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.tomtechproductions.be\/index.php\/wp-json\/wp\/v2\/categories?post=311"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.tomtechproductions.be\/index.php\/wp-json\/wp\/v2\/tags?post=311"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}