{"id":540,"date":"2025-05-29T19:08:17","date_gmt":"2025-05-29T19:08:17","guid":{"rendered":"https:\/\/ouritsource.com\/blog\/?p=540"},"modified":"2025-05-29T19:13:04","modified_gmt":"2025-05-29T19:13:04","slug":"schedule-a-bash-script-to-run","status":"publish","type":"post","link":"https:\/\/ouritsource.com\/blog\/schedule-a-bash-script-to-run\/","title":{"rendered":"Schedule a Bash Script to Run"},"content":{"rendered":"<body>\n<p class=\"has-medium-font-size\">The Following shows how to schedule a Linux bash script so that it runs at 7:15 PM (19:15) ever daily.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p class=\"has-medium-font-size\">1. To schedule a job in Linux, one will need to use command <strong>crontab<\/strong>. For example, in the terminal, one would type:<br><\/p>\n\n\n\n<ol class=\"wp-block-list\"><\/ol>\n\n\n\n<p>sudo crontab -e<\/p>\n\n\n\n<p class=\"has-medium-font-size\">2. In the Vim editor, enter the the hour and minute to run the job as well as the command to run as shown in the example below.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" decoding=\"async\" width=\"640\" height=\"372\" src=\"https:\/\/i0.wp.com\/ouritsource.com\/blog\/wp-content\/uploads\/2025\/05\/image-11.png?resize=640%2C372&#038;ssl=1\" alt=\"\" class=\"wp-image-542\" loading=\"lazy\" srcset=\"https:\/\/i0.wp.com\/ouritsource.com\/blog\/wp-content\/uploads\/2025\/05\/image-11.png?resize=1024%2C595&amp;ssl=1 1024w, https:\/\/i0.wp.com\/ouritsource.com\/blog\/wp-content\/uploads\/2025\/05\/image-11.png?resize=300%2C174&amp;ssl=1 300w, https:\/\/i0.wp.com\/ouritsource.com\/blog\/wp-content\/uploads\/2025\/05\/image-11.png?resize=768%2C446&amp;ssl=1 768w, https:\/\/i0.wp.com\/ouritsource.com\/blog\/wp-content\/uploads\/2025\/05\/image-11.png?resize=900%2C523&amp;ssl=1 900w, https:\/\/i0.wp.com\/ouritsource.com\/blog\/wp-content\/uploads\/2025\/05\/image-11.png?w=1122&amp;ssl=1 1122w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p class=\"has-medium-font-size\">3. Press Shift + : (colon) and type, <strong>w!<\/strong> to save.<br>4. Press Shift + : (colon) again, and  type <strong>q! <\/strong>to exit out.<br>5. To activate the new schedule, restart the crond daemon:<\/p>\n\n\n\n<p class=\"has-normal-font-size\">sudo systemctl  restart crond<\/p>\n\n\n\n<p><\/p>\n<\/body>","protected":false},"excerpt":{"rendered":"<p>The Following shows how to schedule a Linux bash script so that it runs at 7:15 PM (19:15) ever daily. 1. To schedule a job in Linux, one will need to use&#8230;<\/p>\n","protected":false},"author":1,"featured_media":543,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[39],"tags":[],"class_list":["post-540","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","has-thumbnail"],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/ouritsource.com\/blog\/wp-content\/uploads\/2025\/05\/Linux.png?fit=1024%2C1024&ssl=1","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/ouritsource.com\/blog\/wp-json\/wp\/v2\/posts\/540","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ouritsource.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ouritsource.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ouritsource.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ouritsource.com\/blog\/wp-json\/wp\/v2\/comments?post=540"}],"version-history":[{"count":3,"href":"https:\/\/ouritsource.com\/blog\/wp-json\/wp\/v2\/posts\/540\/revisions"}],"predecessor-version":[{"id":547,"href":"https:\/\/ouritsource.com\/blog\/wp-json\/wp\/v2\/posts\/540\/revisions\/547"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ouritsource.com\/blog\/wp-json\/wp\/v2\/media\/543"}],"wp:attachment":[{"href":"https:\/\/ouritsource.com\/blog\/wp-json\/wp\/v2\/media?parent=540"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ouritsource.com\/blog\/wp-json\/wp\/v2\/categories?post=540"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ouritsource.com\/blog\/wp-json\/wp\/v2\/tags?post=540"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}