{"id":62682,"date":"2024-02-14T21:21:50","date_gmt":"2024-02-14T20:21:50","guid":{"rendered":"https:\/\/ekiwi-blog.de\/62682\/reboot-linux-server-automatically-at-2-am\/"},"modified":"2024-02-15T21:37:22","modified_gmt":"2024-02-15T20:37:22","slug":"reboot-linux-server-automatically-at-2-am","status":"publish","type":"post","link":"https:\/\/ekiwi-blog.de\/en\/62682\/reboot-linux-server-automatically-at-2-am\/","title":{"rendered":"Reboot Linux server automatically at 2 a.m."},"content":{"rendered":"<p>Creation of a cron job to restart the Ubuntu server.<\/p>\n<p><!--more--><\/p>\n<p>I wanted to restart my Ubuntu server in the virtual machine automatically. No problem with a cronjob.<\/p>\n<p>First, we connect to the server with a terminal via SSH. Then we can create the cronjob with the following command:<\/p>\n<pre>sudo crontab -e\r\n<\/pre>\n<p>The syntax of a cronjob is as follows:<\/p>\n<pre>minute hour day_of_month month day_of_week command\r\n<\/pre>\n<p>In our example, we now create the cronjob as follows<\/p>\n<pre>0 2 * * * * \/sbin\/shutdown -r now\r\n<\/pre>\n<p>We then save the file. We can perform a check with the following command:<\/p>\n<pre>sudo crontab -l\r\n<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-62678\" src=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2024\/02\/cronjob_1.png\" alt=\"\" width=\"660\" height=\"518\" srcset=\"https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2024\/02\/cronjob_1.png 660w, https:\/\/ekiwi-blog.de\/wp-content\/uploads\/2024\/02\/cronjob_1-300x235.png 300w\" sizes=\"auto, (max-width: 660px) 100vw, 660px\" \/><\/p>","protected":false},"excerpt":{"rendered":"<p>Creation of a cron job to restart the Ubuntu server.<\/p>\n","protected":false},"author":1,"featured_media":18426,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1555],"tags":[1682],"class_list":["post-62682","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software-en","tag-linux-en"],"_links":{"self":[{"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/posts\/62682","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/comments?post=62682"}],"version-history":[{"count":0,"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/posts\/62682\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/media\/18426"}],"wp:attachment":[{"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/media?parent=62682"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/categories?post=62682"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ekiwi-blog.de\/en\/wp-json\/wp\/v2\/tags?post=62682"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}