{"id":303,"date":"2025-03-20T08:42:55","date_gmt":"2025-03-20T08:42:55","guid":{"rendered":"https:\/\/documentation.iqonic.design\/handyman\/?p=303"},"modified":"2025-06-03T11:50:51","modified_gmt":"2025-06-03T11:50:51","slug":"how-to-set-cron-job-for-subscription-plan-expire","status":"publish","type":"post","link":"https:\/\/documentation.iqonic.design\/handyman\/how-to-set-cron-job-for-subscription-plan-expire\/","title":{"rendered":"How to set Cron Job for subscription plan expire?"},"content":{"rendered":"<div class=\"nolwrap\">\n<h3 class=\"wp-block-heading\"><strong>Set Cron Job for subscription plan Expire<\/strong><\/h3>\n\n\n\n<p><strong>1. Locate the Cron Jobs Section<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Scroll down to the &#8220;Advanced&#8221; section.<\/li>\n\n\n\n<li>Click on &#8220;Cron Jobs&#8221;.<\/li>\n<\/ul>\n\n\n\n<p><strong>2. Choose Email Notifications (Optional)<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>If you want to receive an email whenever a cron job runs, enter your email in the &#8220;Cron Email&#8221; section.<\/li>\n<\/ul>\n\n\n\n<p><strong>3. If you don\u2019t want emails, add &gt;\/dev\/null 2&gt;&amp;1 at the end of your cron command.<\/strong><\/p>\n\n\n\n<p><strong>4. Add a New Cron Job<\/strong><\/p>\n\n\n\n<p><strong>5. Select the Execution Time<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Under &#8220;Add New Cron Job&#8221;, choose how often the command should run:<\/strong><\/li>\n<\/ul>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Common Settings: Select from predefined options like &#8220;Once Per Day&#8221; or &#8220;Every 5 Minutes&#8221;.<\/li>\n\n\n\n<li>Custom Timing: Manually set the values:<\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Minute: 0-59 (e.g., 0 for every hour)<\/li>\n\n\n\n<li>Hour: 0-23 (e.g., 2 for 2 AM)<\/li>\n\n\n\n<li>Day: 1-31 (specific days of the month)<\/li>\n\n\n\n<li>Month: 1-12 (specific months)<\/li>\n\n\n\n<li>Weekday: 0-7 (0 or 7 for Sunday, 1 for Monday, etc.)<\/li>\n<\/ul>\n\n\n\n<p><strong>6. Enter the Cron Command<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The command should include the script you want to run. Examples:<\/li>\n\n\n\n<li>php \/home\/username\/public_html<\/li>\n\n\n\n<li>(Replace username with your actual cPanel username)<\/li>\n<\/ul>\n\n\n\n<p>Run Every Hour: 0 * * * * php \/home\/username\/public_html<\/p>\n\n\n\n<p>Run Every Day at Midnight : 0 0 * * * php \/home\/username\/public_html<\/p>\n\n\n\n<p>Disable Email Notifications : php \/home\/username\/public_html &gt;\/dev\/null 2&gt;&amp;1<\/p>\n\n\n\n<p><strong>7. Save the Cron Job<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Click &#8220;Add New Cron Job&#8221; to save it.<\/li>\n<\/ul>\n\n\n\n<p><strong>8. Verify the Cron Job<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Check if the cron job is listed under &#8220;Current Cron Jobs&#8221;.<\/li>\n\n\n\n<li>You can manually run the script in a browser or via SSH to confirm it works.<\/li>\n<\/ul>\n\n\n\n<p><strong>Additional Notes:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Ensure the script has executable permissions (chmod 755 script.php via SSH or File Manager).<\/li>\n\n\n\n<li>Some shared hosting providers require the full path to PHP (\/usr\/bin\/php).<\/li>\n\n\n\n<li>If using wget, the command looks like this:<\/li>\n<\/ul>\n\n\n\n<p><strong>command:<\/strong>&nbsp;cd \/home\/your_username\/public_html &amp;&amp; \/usr\/local\/bin\/php artisan schedule:run &gt;&gt; \/home\/your_username\/cron.log 2&gt;&amp;1<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"cPanel Tutorials - Cron Jobs\" width=\"500\" height=\"281\" src=\"https:\/\/www.youtube.com\/embed\/YwpUjz1tMbA?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<p><\/p>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>Set Cron Job for subscription plan Expire 1. Locate the Cron Jobs Section 2. Choose Email Notifications (Optional) 3. If you don\u2019t want emails, add &gt;\/dev\/null 2&gt;&amp;1 at the end of your cron command. 4. Add a New Cron Job 5. Select the Execution Time 6. Enter the Cron Command Run Every Hour: 0 * [&hellip;]<\/p>\n","protected":false},"author":11,"featured_media":0,"parent":259,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-303","post","type-post","status-publish","format-standard","hentry","category-handyman-services"],"featured_image_src":null,"author_info":{"display_name":"laraveladminiq","author_link":"https:\/\/documentation.iqonic.design\/handyman\/author\/laraveladminiq\/"},"children":[],"_links":{"self":[{"href":"https:\/\/documentation.iqonic.design\/handyman\/wp-json\/wp\/v2\/posts\/303","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/documentation.iqonic.design\/handyman\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/documentation.iqonic.design\/handyman\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/documentation.iqonic.design\/handyman\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/documentation.iqonic.design\/handyman\/wp-json\/wp\/v2\/comments?post=303"}],"version-history":[{"count":6,"href":"https:\/\/documentation.iqonic.design\/handyman\/wp-json\/wp\/v2\/posts\/303\/revisions"}],"predecessor-version":[{"id":631,"href":"https:\/\/documentation.iqonic.design\/handyman\/wp-json\/wp\/v2\/posts\/303\/revisions\/631"}],"up":[{"embeddable":true,"href":"https:\/\/documentation.iqonic.design\/handyman\/wp-json\/wp\/v2\/posts\/259"}],"wp:attachment":[{"href":"https:\/\/documentation.iqonic.design\/handyman\/wp-json\/wp\/v2\/media?parent=303"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/documentation.iqonic.design\/handyman\/wp-json\/wp\/v2\/categories?post=303"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/documentation.iqonic.design\/handyman\/wp-json\/wp\/v2\/tags?post=303"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}