{"id":38244,"date":"2026-01-21T13:59:36","date_gmt":"2026-01-21T06:59:36","guid":{"rendered":"https:\/\/interdata.vn\/blog\/?p=38244"},"modified":"2026-01-21T16:16:54","modified_gmt":"2026-01-21T09:16:54","slug":"cron-job-vps-linux","status":"publish","type":"post","link":"https:\/\/interdata.vn\/blog\/cron-job-vps-linux\/","title":{"rendered":"H\u01b0\u1edbng d\u1eabn Cron job VPS Linux \u0111\u01a1n gi\u1ea3n, chi ti\u1ebft, ai c\u0169ng l\u00e0m \u0111\u01b0\u1ee3c"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_85 counter-hierarchy ez-toc-counter ez-toc-white ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">N\u1ed8I DUNG<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 eztoc-toggle-hide-by-default' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/interdata.vn\/blog\/cron-job-vps-linux\/#Cron-Jobs-la-gi-trong-Linux\" >Cron Jobs l\u00e0 g\u00ec trong Linux?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/interdata.vn\/blog\/cron-job-vps-linux\/#Uu-diem-va-nhuoc-diem-khi-su-dung-Cron-Job\" >\u01afu \u0111i\u1ec3m v\u00e0 nh\u01b0\u1ee3c \u0111i\u1ec3m khi s\u1eed d\u1ee5ng Cron Job<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/interdata.vn\/blog\/cron-job-vps-linux\/#Uu-diem-cua-Cron-Job\" >\u01afu \u0111i\u1ec3m c\u1ee7a Cron Job<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/interdata.vn\/blog\/cron-job-vps-linux\/#Nhuoc-diem-cua-Cron-Job\" >Nh\u01b0\u1ee3c \u0111i\u1ec3m c\u1ee7a Cron Job<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/interdata.vn\/blog\/cron-job-vps-linux\/#Huong-dan-tao-Cron-Job-tren-VPS-Linux\" >H\u01b0\u1edbng d\u1eabn t\u1ea1o Cron Job tr\u00ean VPS Linux<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/interdata.vn\/blog\/cron-job-vps-linux\/#Cau-truc-chuan-cua-mot-Cron-Job\" >C\u1ea5u tr\u00fac chu\u1ea9n c\u1ee7a m\u1ed9t Cron Job<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/interdata.vn\/blog\/cron-job-vps-linux\/#Cac-ky-tu-dac-biet-trong-Cron-Job\" >C\u00e1c k\u00fd t\u1ef1 \u0111\u1eb7c bi\u1ec7t trong Cron Job<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/interdata.vn\/blog\/cron-job-vps-linux\/#Vi-du-Cron-Job-thuong-dung-tren-VPS\" >V\u00ed d\u1ee5 Cron Job th\u01b0\u1eddng d\u00f9ng tr\u00ean VPS<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/interdata.vn\/blog\/cron-job-vps-linux\/#Cac-tuy-chon-quan-ly-Cron-Job\" >C\u00e1c t\u00f9y ch\u1ecdn qu\u1ea3n l\u00fd Cron Job<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/interdata.vn\/blog\/cron-job-vps-linux\/#Chuoi-rut-gon-trong-Crontab\" >Chu\u1ed7i r\u00fat g\u1ecdn trong Crontab<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<p>Cron l\u00e0 m\u1ed9t trong nh\u1eefng c\u00f4ng c\u1ee5 quan tr\u1ecdng c\u1ee7a Linux, cho ph\u00e9p ng\u01b0\u1eddi d\u00f9ng <strong>thi\u1ebft l\u1eadp v\u00e0 ch\u1ea1y l\u1ec7nh t\u1ef1 \u0111\u1ed9ng theo c\u00e1c m\u1ed1c th\u1eddi gian \u0111\u1ecbnh s\u1eb5n<\/strong>. Nh\u1edd kh\u1ea3 n\u0103ng n\u00e0y, Cron tr\u1edf th\u00e0nh c\u00f4ng c\u1ee5 quen thu\u1ed9c v\u00e0 \u0111\u01b0\u1ee3c nhi\u1ec1u l\u1eadp tr\u00ecnh vi\u00ean \u01b0a chu\u1ed9ng trong qu\u00e1 tr\u00ecnh qu\u1ea3n tr\u1ecb h\u1ec7 th\u1ed1ng.<\/p>\n<p>V\u1edbi Cron Job, b\u1ea1n c\u00f3 th\u1ec3 d\u1ec5 d\u00e0ng t\u1ef1 \u0111\u1ed9ng h\u00f3a nhi\u1ec1u t\u00e1c v\u1ee5 th\u01b0\u1eddng ng\u00e0y nh\u01b0 sao l\u01b0u d\u1eef li\u1ec7u, d\u1ecdn d\u1eb9p th\u01b0 m\u1ee5c, g\u1eedi th\u00f4ng b\u00e1o ho\u1eb7c th\u1ef1c hi\u1ec7n c\u00e1c c\u00f4ng vi\u1ec7c l\u1eb7p l\u1ea1i kh\u00e1c m\u00e0 kh\u00f4ng c\u1ea7n can thi\u1ec7p th\u1ee7 c\u00f4ng.<\/p>\n<p>Trong b\u00e0i vi\u1ebft n\u00e0y, <strong>InterData<\/strong> s\u1ebd h\u01b0\u1edbng d\u1eabn b\u1ea1n <a href=\"https:\/\/interdata.vn\/blog\/cron-job-vps-linux\/\"><strong>c\u00e1ch t\u1ea1o Cron Job tr\u00ean VPS Linux <\/strong><\/a>m\u1ed9t c\u00e1ch chi ti\u1ebft, k\u00e8m theo c\u00e1c v\u00ed d\u1ee5 minh h\u1ecda d\u1ec5 hi\u1ec3u \u0111\u1ec3 b\u1ea1n c\u00f3 th\u1ec3 \u00e1p d\u1ee5ng ngay trong th\u1ef1c t\u1ebf.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Cron-Jobs-la-gi-trong-Linux\"><\/span>Cron Jobs l\u00e0 g\u00ec trong Linux?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Cron Job l\u00e0 m\u1ed9t c\u01a1 ch\u1ebf tr\u00ean h\u1ec7 \u0111i\u1ec1u h\u00e0nh Linux cho ph\u00e9p <strong>l\u00ean l\u1ecbch th\u1ef1c thi t\u1ef1 \u0111\u1ed9ng c\u00e1c l\u1ec7nh ho\u1eb7c t\u00e1c v\u1ee5 l\u1eb7p l\u1ea1i theo th\u1eddi gian x\u00e1c \u0111\u1ecbnh<\/strong>. T\u00ednh n\u0103ng n\u00e0y \u0111\u1eb7c bi\u1ec7t h\u1eefu \u00edch tr\u00ean VPS khi c\u1ea7n t\u1ef1 \u0111\u1ed9ng h\u00f3a nh\u1eefng c\u00f4ng vi\u1ec7c th\u1ee7 c\u00f4ng di\u1ec5n ra th\u01b0\u1eddng xuy\u00ean, gi\u00fap gi\u1ea3m thao t\u00e1c th\u1ee7 c\u00f4ng v\u00e0 ti\u1ebft ki\u1ec7m th\u1eddi gian qu\u1ea3n tr\u1ecb h\u1ec7 th\u1ed1ng.<\/p>\n<figure id=\"attachment_38253\" aria-describedby=\"caption-attachment-38253\" style=\"width: 670px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-38253\" src=\"https:\/\/interdata.vn\/blog\/wp-content\/uploads\/2026\/01\/Cron-job-la-gi-tren-Linux.png\" alt=\"Cron job l\u00e0 g\u00ec tr\u00ean Linux\" width=\"670\" height=\"376\" title=\"\" srcset=\"https:\/\/interdata.vn\/blog\/wp-content\/uploads\/2026\/01\/Cron-job-la-gi-tren-Linux.png 670w, https:\/\/interdata.vn\/blog\/wp-content\/uploads\/2026\/01\/Cron-job-la-gi-tren-Linux-300x168.png 300w\" sizes=\"auto, (max-width: 670px) 100vw, 670px\" \/><figcaption id=\"caption-attachment-38253\" class=\"wp-caption-text\">Cron job l\u00e0 g\u00ec trong Linux<\/figcaption><\/figure>\n<h2><span class=\"ez-toc-section\" id=\"Uu-diem-va-nhuoc-diem-khi-su-dung-Cron-Job\"><\/span>\u01afu \u0111i\u1ec3m v\u00e0 nh\u01b0\u1ee3c \u0111i\u1ec3m khi s\u1eed d\u1ee5ng Cron Job<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Vi\u1ec7c \u00e1p d\u1ee5ng Cron Job mang l\u1ea1i nhi\u1ec1u l\u1ee3i \u00edch trong v\u1eadn h\u00e0nh h\u1ec7 th\u1ed1ng, tuy nhi\u00ean v\u1eabn t\u1ed3n t\u1ea1i m\u1ed9t s\u1ed1 \u0111i\u1ec3m h\u1ea1n ch\u1ebf c\u1ea7n l\u01b0u \u00fd.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Uu-diem-cua-Cron-Job\"><\/span>\u01afu \u0111i\u1ec3m c\u1ee7a Cron Job<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<ul>\n<li><strong>T\u1ef1 \u0111\u1ed9ng h\u00f3a hi\u1ec7u qu\u1ea3<\/strong>: Cron Job cho ph\u00e9p h\u1ec7 th\u1ed1ng t\u1ef1 \u0111\u1ed9ng th\u1ef1c hi\u1ec7n c\u00e1c t\u00e1c v\u1ee5 l\u1eb7p l\u1ea1i m\u00e0 kh\u00f4ng c\u1ea7n s\u1ef1 can thi\u1ec7p c\u1ee7a con ng\u01b0\u1eddi.<\/li>\n<li><strong>Linh ho\u1ea1t trong l\u1eadp l\u1ecbch<\/strong>: Ng\u01b0\u1eddi d\u00f9ng c\u00f3 th\u1ec3 t\u00f9y ch\u1ec9nh chi ti\u1ebft th\u1eddi gian ch\u1ea1y theo ph\u00fat, gi\u1edd, ng\u00e0y ho\u1eb7c th\u00e1ng \u0111\u1ec3 ph\u00f9 h\u1ee3p v\u1edbi t\u1eebng nhu c\u1ea7u c\u1ee5 th\u1ec3.<\/li>\n<li><strong>T\u1ed1i \u01b0u hi\u1ec7u su\u1ea5t l\u00e0m vi\u1ec7c<\/strong>: Vi\u1ec7c gi\u1ea3m thao t\u00e1c th\u1ee7 c\u00f4ng gi\u00fap h\u1ea1n ch\u1ebf sai s\u00f3t v\u00e0 n\u00e2ng cao hi\u1ec7u qu\u1ea3 qu\u1ea3n l\u00fd h\u1ec7 th\u1ed1ng.<\/li>\n<\/ul>\n<h3><span class=\"ez-toc-section\" id=\"Nhuoc-diem-cua-Cron-Job\"><\/span>Nh\u01b0\u1ee3c \u0111i\u1ec3m c\u1ee7a Cron Job<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<ul>\n<li><strong>C\u00fa ph\u00e1p kh\u00f3 ti\u1ebfp c\u1eadn v\u1edbi ng\u01b0\u1eddi m\u1edbi<\/strong>: C\u00e1ch vi\u1ebft cron v\u1edbi nhi\u1ec1u k\u00fd t\u1ef1 v\u00e0 quy \u01b0\u1edbc th\u1eddi gian c\u00f3 th\u1ec3 g\u00e2y nh\u1ea7m l\u1eabn cho ng\u01b0\u1eddi ch\u01b0a quen.<\/li>\n<li><strong>Thi\u1ebfu giao di\u1ec7n qu\u1ea3n l\u00fd tr\u1ef1c quan<\/strong>: Cron Job kh\u00f4ng c\u00f3 giao di\u1ec7n \u0111\u1ed3 h\u1ecda m\u1eb7c \u0111\u1ecbnh, to\u00e0n b\u1ed9 qu\u00e1 tr\u00ecnh c\u1ea5u h\u00ecnh v\u00e0 qu\u1ea3n l\u00fd \u0111\u1ec1u th\u1ef1c hi\u1ec7n qua d\u00f2ng l\u1ec7nh.<\/li>\n<li><strong>Kh\u1ea3 n\u0103ng x\u1eed l\u00fd l\u1ed7i c\u00f2n h\u1ea1n ch\u1ebf<\/strong>: Khi cron job g\u1eb7p l\u1ed7i trong qu\u00e1 tr\u00ecnh ch\u1ea1y, h\u1ec7 th\u1ed1ng s\u1ebd kh\u00f4ng t\u1ef1 \u0111\u1ed9ng c\u1ea3nh b\u00e1o n\u1ebfu ch\u01b0a \u0111\u01b0\u1ee3c thi\u1ebft l\u1eadp b\u1ed5 sung.<\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"Huong-dan-tao-Cron-Job-tren-VPS-Linux\"><\/span>H\u01b0\u1edbng d\u1eabn t\u1ea1o Cron Job tr\u00ean VPS Linux<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"Cau-truc-chuan-cua-mot-Cron-Job\"><\/span>C\u1ea5u tr\u00fac chu\u1ea9n c\u1ee7a m\u1ed9t Cron Job<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>C\u1ea5u tr\u00fac t\u1ed5ng qu\u00e1t c\u1ee7a m\u1ed9t cron job \u0111\u01b0\u1ee3c vi\u1ebft nh\u01b0 sau:<\/p>\n<pre>A B C D E USERNAME path\/to\/command arg1 arg2<\/pre>\n<p>Trong \u0111\u00f3:<\/p>\n<ul>\n<li><strong>A<\/strong>: Ph\u1ea7n gi\u00e2y c\u1ee7a l\u1ecbch ch\u1ea1y, gi\u00e1 tr\u1ecb t\u1eeb 0 \u0111\u1ebfn 59<\/li>\n<li><strong>B<\/strong>: Ph\u1ea7n ph\u00fat c\u1ee7a l\u1ecbch ch\u1ea1y, gi\u00e1 tr\u1ecb t\u1eeb 0 \u0111\u1ebfn 59<\/li>\n<li><strong>C<\/strong>: Ph\u1ea7n gi\u1edd c\u1ee7a l\u1ecbch ch\u1ea1y, gi\u00e1 tr\u1ecb t\u1eeb 0 \u0111\u1ebfn 23<\/li>\n<li><strong>D<\/strong>: Ng\u00e0y trong th\u00e1ng, gi\u00e1 tr\u1ecb t\u1eeb 1 \u0111\u1ebfn 31<\/li>\n<li><strong>E<\/strong>: Th\u00e1ng trong n\u0103m, gi\u00e1 tr\u1ecb t\u1eeb 1 \u0111\u1ebfn 12<\/li>\n<li><strong>USERNAME<\/strong>: T\u00e0i kho\u1ea3n Linux m\u00e0 cron job s\u1ebd ch\u1ea1y d\u01b0\u1edbi quy\u1ec1n \u0111\u00f3<\/li>\n<li><strong>path\/to\/command<\/strong>: \u0110\u01b0\u1eddng d\u1eabn \u0111\u1ebfn l\u1ec7nh ho\u1eb7c t\u1ec7p c\u1ea7n th\u1ef1c thi<\/li>\n<li><strong>arg1, arg2<\/strong>: C\u00e1c tham s\u1ed1 truy\u1ec1n v\u00e0o cho l\u1ec7nh ho\u1eb7c ch\u01b0\u01a1ng tr\u00ecnh<\/li>\n<\/ul>\n<figure id=\"attachment_38254\" aria-describedby=\"caption-attachment-38254\" style=\"width: 800px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-38254\" src=\"https:\/\/interdata.vn\/blog\/wp-content\/uploads\/2026\/01\/Cau-truc-chuan-cua-mot-Cron-Job.jpg\" alt=\"C\u1ea5u tr\u00fac chu\u1ea9n c\u1ee7a m\u1ed9t Cron Job\" width=\"800\" height=\"500\" title=\"\" srcset=\"https:\/\/interdata.vn\/blog\/wp-content\/uploads\/2026\/01\/Cau-truc-chuan-cua-mot-Cron-Job.jpg 800w, https:\/\/interdata.vn\/blog\/wp-content\/uploads\/2026\/01\/Cau-truc-chuan-cua-mot-Cron-Job-300x188.jpg 300w, https:\/\/interdata.vn\/blog\/wp-content\/uploads\/2026\/01\/Cau-truc-chuan-cua-mot-Cron-Job-768x480.jpg 768w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><figcaption id=\"caption-attachment-38254\" class=\"wp-caption-text\">C\u1ea5u tr\u00fac chu\u1ea9n c\u1ee7a m\u1ed9t Cron Job<\/figcaption><\/figure>\n<p><strong>V\u00ed d\u1ee5:<\/strong><\/p>\n<pre>A B C D E USERNAME root\/backup.sh<\/pre>\n<p>Trong \u0111\u00f3:<\/p>\n<ul>\n<li><strong>A<\/strong> l\u00e0 ph\u1ea7n gi\u00e2y<\/li>\n<li><strong>B<\/strong> l\u00e0 ph\u1ea7n ph\u00fat<\/li>\n<li><strong>C<\/strong> l\u00e0 ph\u1ea7n gi\u1edd<\/li>\n<li><strong>D<\/strong> l\u00e0 ng\u00e0y trong th\u00e1ng<\/li>\n<li><strong>E<\/strong> l\u00e0 th\u00e1ng<\/li>\n<li><strong>USERNAME<\/strong> l\u00e0 t\u00e0i kho\u1ea3n ch\u1ea1y cron job, \u1edf \u0111\u00e2y l\u00e0 <code>root<\/code>, ngh\u0129a l\u00e0 script s\u1ebd ch\u1ea1y v\u1edbi quy\u1ec1n qu\u1ea3n tr\u1ecb cao nh\u1ea5t<\/li>\n<\/ul>\n<p><code>\/root\/backup.sh<\/code> l\u00e0 \u0111\u01b0\u1eddng d\u1eabn \u0111\u1ebfn file script c\u00f3 t\u00ean <em>backup.sh<\/em> n\u1eb1m trong th\u01b0 m\u1ee5c g\u1ed1c c\u1ee7a h\u1ec7 th\u1ed1ng.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Cac-ky-tu-dac-biet-trong-Cron-Job\"><\/span>C\u00e1c k\u00fd t\u1ef1 \u0111\u1eb7c bi\u1ec7t trong Cron Job<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Khi thi\u1ebft l\u1eadp Cron Job tr\u00ean VPS Linux, b\u1ea1n c\u00f3 th\u1ec3 s\u1eed d\u1ee5ng m\u1ed9t s\u1ed1 k\u00fd t\u1ef1 \u0111\u1eb7c bi\u1ec7t \u0111\u1ec3 x\u00e1c \u0111\u1ecbnh m\u1eabu th\u1eddi gian ho\u1eb7c \u0111i\u1ec1u ki\u1ec7n ch\u1ea1y linh ho\u1ea1t h\u01a1n.<\/p>\n<p>C\u00e1c k\u00fd t\u1ef1 th\u01b0\u1eddng g\u1eb7p bao g\u1ed3m:<\/p>\n<ul>\n<li><strong>*<\/strong> (asterisk): \u0110\u1ea1i di\u1ec7n cho t\u1ea5t c\u1ea3 c\u00e1c gi\u00e1 tr\u1ecb<\/li>\n<li><strong>\/<\/strong> (slash): Ch\u1ec9 \u0111\u1ecbnh kho\u1ea3ng c\u00e1ch ho\u1eb7c b\u01b0\u1edbc nh\u1ea3y<\/li>\n<li><strong>&#8211;<\/strong> (dash): X\u00e1c \u0111\u1ecbnh m\u1ed9t kho\u1ea3ng th\u1eddi gian li\u00ean t\u1ee5c<\/li>\n<li><strong>,<\/strong> (comma): Li\u1ec7t k\u00ea nhi\u1ec1u gi\u00e1 tr\u1ecb kh\u00e1c nhau<\/li>\n<li><strong>?<\/strong>: D\u00f9ng khi kh\u00f4ng x\u00e1c \u0111\u1ecbnh gi\u00e1 tr\u1ecb c\u1ee5 th\u1ec3 cho m\u1ed9t tr\u01b0\u1eddng th\u1eddi gian<\/li>\n<\/ul>\n<p>V\u00ed d\u1ee5:<\/p>\n<pre>- * * * * USERNAME path\/to\/command arg1 arg2<\/pre>\n<p>Trong tr\u01b0\u1eddng h\u1ee3p n\u00e0y, to\u00e0n b\u1ed9 c\u00e1c tr\u01b0\u1eddng th\u1eddi gian \u0111\u1ec1u \u0111\u1eb7t l\u00e0 <code>*<\/code>, ngh\u0129a l\u00e0 cron job s\u1ebd ch\u1ea1y li\u00ean t\u1ee5c m\u00e0 kh\u00f4ng b\u1ecb gi\u1edbi h\u1ea1n th\u1eddi \u0111i\u1ec3m.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Vi-du-Cron-Job-thuong-dung-tren-VPS\"><\/span>V\u00ed d\u1ee5 Cron Job th\u01b0\u1eddng d\u00f9ng tr\u00ean VPS<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u0110\u1ec3 ch\u1ec9nh s\u1eeda cron job, s\u1eed d\u1ee5ng l\u1ec7nh:<\/p>\n<p><code>crontab -e<\/code><\/p>\n<p>M\u1ed9t s\u1ed1 v\u00ed d\u1ee5 ph\u1ed5 bi\u1ebfn:<\/p>\n<p>Ch\u1ea1y script <code>\/root\/backup.sh<\/code> l\u00fac <strong>23 gi\u1edd 30 ph\u00fat m\u1ed7i ng\u00e0y<\/strong><\/p>\n<p><code>30 23 * * * \/root\/backup.sh<\/code><\/p>\n<p>Ch\u1ea1y script v\u00e0o <strong>23 gi\u1edd 30 ph\u00fat ng\u00e0y 28 h\u00e0ng th\u00e1ng<\/strong><\/p>\n<p><code><\/code><code>30 23 28 * * \/root\/backup.sh<\/code><\/p>\n<p>Ch\u1ea1y script v\u00e0o <strong>23 gi\u1edd 30 ph\u00fat t\u1eeb th\u1ee9 Hai \u0111\u1ebfn th\u1ee9 S\u00e1u<\/strong><\/p>\n<p><code>30 23 * * 0-4 \/root\/backup.sh<\/code><\/p>\n<p>Ch\u1ea1y script v\u00e0o <strong>23 gi\u1edd m\u1ed7i Ch\u1ee7 Nh\u1eadt<\/strong><\/p>\n<p><code>0 23 * * sun \/root\/backup.sh<\/code><\/p>\n<figure id=\"attachment_38245\" aria-describedby=\"caption-attachment-38245\" style=\"width: 560px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-38245\" src=\"https:\/\/interdata.vn\/blog\/wp-content\/uploads\/2026\/01\/Vi-du-ve-Cron-Jobs.png\" alt=\"V\u00ed d\u1ee5 v\u1ec1 Cron Jobs\" width=\"560\" height=\"293\" title=\"\" srcset=\"https:\/\/interdata.vn\/blog\/wp-content\/uploads\/2026\/01\/Vi-du-ve-Cron-Jobs.png 560w, https:\/\/interdata.vn\/blog\/wp-content\/uploads\/2026\/01\/Vi-du-ve-Cron-Jobs-300x157.png 300w\" sizes=\"auto, (max-width: 560px) 100vw, 560px\" \/><figcaption id=\"caption-attachment-38245\" class=\"wp-caption-text\">V\u00ed d\u1ee5 v\u1ec1 Cron Jobs<\/figcaption><\/figure>\n<h3><span class=\"ez-toc-section\" id=\"Cac-tuy-chon-quan-ly-Cron-Job\"><\/span>C\u00e1c t\u00f9y ch\u1ecdn qu\u1ea3n l\u00fd Cron Job<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><strong>Li\u1ec7t k\u00ea c\u00e1c cron job hi\u1ec7n c\u00f3<\/strong><\/p>\n<p><code><\/code><code>crontab -l<\/code> ho\u1eb7c <code>crontab -u username -l<\/code><\/p>\n<figure id=\"attachment_38247\" aria-describedby=\"caption-attachment-38247\" style=\"width: 600px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-38247\" src=\"https:\/\/interdata.vn\/blog\/wp-content\/uploads\/2026\/01\/Liet-ke-Cron-Jobs-1.png\" alt=\"Li\u1ec7t k\u00ea cron jobs\" width=\"600\" height=\"160\" title=\"\" srcset=\"https:\/\/interdata.vn\/blog\/wp-content\/uploads\/2026\/01\/Liet-ke-Cron-Jobs-1.png 600w, https:\/\/interdata.vn\/blog\/wp-content\/uploads\/2026\/01\/Liet-ke-Cron-Jobs-1-300x80.png 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><figcaption id=\"caption-attachment-38247\" class=\"wp-caption-text\">Li\u1ec7t k\u00ea cron jobs<\/figcaption><\/figure>\n<p><strong>X\u00f3a to\u00e0n b\u1ed9 cron job c\u1ee7a ng\u01b0\u1eddi d\u00f9ng hi\u1ec7n t\u1ea1i<\/strong><\/p>\n<p><code>crontab -r<\/code><\/p>\n<p><strong>X\u00f3a cron job c\u1ee7a m\u1ed9t user c\u1ee5 th\u1ec3<\/strong><\/p>\n<p><code>crontab -r -u username<\/code><\/p>\n<h3><span class=\"ez-toc-section\" id=\"Chuoi-rut-gon-trong-Crontab\"><\/span>Chu\u1ed7i r\u00fat g\u1ecdn trong Crontab<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Cron cung c\u1ea5p c\u00e1c chu\u1ed7i vi\u1ebft t\u1eaft gi\u00fap t\u1ea1o l\u1ecbch nhanh h\u01a1n m\u00e0 kh\u00f4ng c\u1ea7n nh\u1eadp \u0111\u1ea7y \u0111\u1ee7 c\u00fa ph\u00e1p th\u1eddi gian:<\/p>\n<ul>\n<li><code>@hourly<\/code>: Ch\u1ea1y m\u1ed7i gi\u1edd m\u1ed9t l\u1ea7n (0 * * * *)<\/li>\n<li><code>@midnight<\/code>: Ch\u1ea1y m\u1ed7i ng\u00e0y m\u1ed9t l\u1ea7n (0 0 * * *)<\/li>\n<li><code>@daily<\/code>: T\u01b0\u01a1ng \u0111\u01b0\u01a1ng @midnight<\/li>\n<li><code>@weekly<\/code>: Ch\u1ea1y m\u1ed7i tu\u1ea7n m\u1ed9t l\u1ea7n (0 0 * * 0)<\/li>\n<li><code>@monthly<\/code>: Ch\u1ea1y m\u1ed7i th\u00e1ng m\u1ed9t l\u1ea7n (0 0 1 * *)<\/li>\n<li><code>@annually<\/code>: Ch\u1ea1y m\u1ed7i n\u0103m m\u1ed9t l\u1ea7n (0 0 1 1 *)<\/li>\n<li><code>@yearly<\/code>: T\u01b0\u01a1ng \u0111\u01b0\u01a1ng @annually<\/li>\n<li><code>@reboot<\/code>: Ch\u1ea1y m\u1ed7i khi VPS ho\u1eb7c server kh\u1edfi \u0111\u1ed9ng l\u1ea1i<\/li>\n<\/ul>\n<p>V\u00ed d\u1ee5 sao l\u01b0u h\u1ec7 th\u1ed1ng m\u1ed7i ng\u00e0y:<\/p>\n<p><code>@daily \/path\/to\/backup\/script.sh<\/code><\/p>\n<figure id=\"attachment_38248\" aria-describedby=\"caption-attachment-38248\" style=\"width: 580px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-38248\" src=\"https:\/\/interdata.vn\/blog\/wp-content\/uploads\/2026\/01\/Cach-sao-luu-he-thong.png\" alt=\"C\u00e1ch sao l\u01b0u h\u1ec7 th\u1ed1ng\" width=\"580\" height=\"297\" title=\"\" srcset=\"https:\/\/interdata.vn\/blog\/wp-content\/uploads\/2026\/01\/Cach-sao-luu-he-thong.png 580w, https:\/\/interdata.vn\/blog\/wp-content\/uploads\/2026\/01\/Cach-sao-luu-he-thong-300x154.png 300w\" sizes=\"auto, (max-width: 580px) 100vw, 580px\" \/><figcaption id=\"caption-attachment-38248\" class=\"wp-caption-text\">V\u00ed d\u1ee5 v\u1ec1 c\u00e1ch sao l\u01b0u h\u1ec7 th\u1ed1ng<\/figcaption><\/figure>\n<div class=\"highlight-cta-box\">\n<p>N\u1ebfu b\u1ea1n \u0111ang t\u00ecm ki\u1ebfm m\u1ed9t m\u00f4i tr\u01b0\u1eddng <strong>VPS Linux t\u1ed1c \u0111\u1ed9 cao, \u1ed5n \u0111\u1ecbnh<\/strong>, <strong>hi\u1ec7u n\u0103ng cao<\/strong> v\u00e0 d\u1ec5 qu\u1ea3n tr\u1ecb, <strong>d\u1ecbch v\u1ee5 VPS Linux t\u1ea1i InterData<\/strong> l\u00e0 l\u1ef1a ch\u1ecdn ph\u00f9 h\u1ee3p cho c\u00e1c website, \u1ee9ng d\u1ee5ng v\u00e0 h\u1ec7 th\u1ed1ng c\u1ea7n v\u1eadn h\u00e0nh li\u00ean t\u1ee5c. VPS Linux c\u1ee7a InterData s\u1eed d\u1ee5ng h\u1ea1 t\u1ea7ng ph\u1ea7n c\u1ee9ng m\u1edbi nh\u1ea5t, m\u1ea1nh m\u1ebd, k\u1ebft n\u1ed1i m\u1ea1ng t\u1ed1c \u0111\u1ed9 cao, h\u1ed7 tr\u1ee3 \u0111\u1ea7y \u0111\u1ee7 c\u00e1c b\u1ea3n ph\u00e2n ph\u1ed1i Linux v\u00e0 cho ph\u00e9p to\u00e0n quy\u1ec1n qu\u1ea3n tr\u1ecb (root access).<\/p>\n<p>B\u00ean c\u1ea1nh \u0111\u00f3, InterData cung c\u1ea5p d\u1ecbch v\u1ee5 VPS Linux <strong>d\u00f9ng th\u1eed 7 ng\u00e0y<\/strong>, ch\u1ec9 t\u1eeb <strong>95K\/Th\u00e1ng<\/strong>, t\u00e0i nguy\u00ean r\u00f5 r\u00e0ng, minh b\u1ea1ch, kh\u1ea3 n\u0103ng n\u00e2ng c\u1ea5p linh ho\u1ea1t c\u00f9ng <strong>\u0111\u1ed9i ng\u0169 k\u1ef9 thu\u1eadt h\u1ed7 tr\u1ee3 24\/7<\/strong> su\u1ed1t qu\u00e1 tr\u00ecnh s\u1eed d\u1ee5ng, gi\u00fap doanh nghi\u1ec7p v\u00e0 c\u00e1 nh\u00e2n y\u00ean t\u00e2m tri\u1ec3n khai c\u00e1c t\u00e1c v\u1ee5 nh\u01b0 web server, database, cron job hay t\u1ef1 \u0111\u1ed9ng h\u00f3a h\u1ec7 th\u1ed1ng.<\/p>\n<a href=\"https:\/\/interdata.vn\/vps-linux\" class=\"button primary is-primary is-medium\"  >\n\t\t<span>Tham kh\u1ea3o c\u1ea5u h\u00ecnh d\u1ecbch v\u1ee5 VPS Linux InterData<\/span>\n\t<\/a>\n\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Cron l\u00e0 m\u1ed9t trong nh\u1eefng c\u00f4ng c\u1ee5 quan tr\u1ecdng c\u1ee7a Linux, cho ph\u00e9p ng\u01b0\u1eddi d\u00f9ng thi\u1ebft l\u1eadp v\u00e0 ch\u1ea1y l\u1ec7nh t\u1ef1 \u0111\u1ed9ng theo c\u00e1c m\u1ed1c th\u1eddi gian \u0111\u1ecbnh s\u1eb5n. Nh\u1edd kh\u1ea3 n\u0103ng n\u00e0y, Cron tr\u1edf th\u00e0nh c\u00f4ng c\u1ee5 quen thu\u1ed9c v\u00e0 \u0111\u01b0\u1ee3c nhi\u1ec1u l\u1eadp tr\u00ecnh vi\u00ean \u01b0a chu\u1ed9ng trong qu\u00e1 tr\u00ecnh qu\u1ea3n tr\u1ecb h\u1ec7 th\u1ed1ng.<\/p>\n","protected":false},"author":11,"featured_media":38263,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[49],"tags":[],"class_list":["post-38244","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-vps"],"_links":{"self":[{"href":"https:\/\/interdata.vn\/blog\/wp-json\/wp\/v2\/posts\/38244","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/interdata.vn\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/interdata.vn\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/interdata.vn\/blog\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/interdata.vn\/blog\/wp-json\/wp\/v2\/comments?post=38244"}],"version-history":[{"count":5,"href":"https:\/\/interdata.vn\/blog\/wp-json\/wp\/v2\/posts\/38244\/revisions"}],"predecessor-version":[{"id":38294,"href":"https:\/\/interdata.vn\/blog\/wp-json\/wp\/v2\/posts\/38244\/revisions\/38294"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/interdata.vn\/blog\/wp-json\/wp\/v2\/media\/38263"}],"wp:attachment":[{"href":"https:\/\/interdata.vn\/blog\/wp-json\/wp\/v2\/media?parent=38244"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/interdata.vn\/blog\/wp-json\/wp\/v2\/categories?post=38244"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/interdata.vn\/blog\/wp-json\/wp\/v2\/tags?post=38244"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}