{"id":43870,"date":"2021-12-16T18:05:32","date_gmt":"2021-12-16T11:05:32","guid":{"rendered":"https:\/\/wiki.tino.org\/staging\/?p=43870"},"modified":"2026-10-26T10:27:33","modified_gmt":"2026-10-26T03:27:33","slug":"crontab-la-gi","status":"publish","type":"post","link":"https:\/\/tino.vn\/blog\/crontab-la-gi\/","title":{"rendered":"Crontab l\u00e0 g\u00ec? C\u00e1ch d\u00f9ng l\u1ec7nh crontab tr\u00ean Linux (Ubuntu)"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><strong>Crontab (cron table) l\u00e0 b\u1ea3ng l\u1ecbch c\u1ee7a t\u1eebng ng\u01b0\u1eddi d\u00f9ng tr\u00ean Linux, m\u1ed7i d\u00f2ng g\u1ed3m 5 tr\u01b0\u1eddng th\u1eddi gian v\u00e0 m\u1ed9t l\u1ec7nh; <code>crontab<\/code> c\u0169ng l\u00e0 t\u00ean l\u1ec7nh \u0111\u1ec3 xem, s\u1eeda, xo\u00e1 b\u1ea3ng \u0111\u00f3.<\/strong> Ch\u01b0\u01a1ng tr\u00ecnh ch\u1ea1y n\u1ec1n cron \u0111\u1ecdc c\u00e1c b\u1ea3ng n\u00e0y m\u1ed7i ph\u00fat v\u00e0 th\u1ef1c thi l\u1ec7nh \u0111\u1ebfn gi\u1edd. Hai l\u1ec7nh d\u00f9ng th\u01b0\u1eddng xuy\u00ean l\u00e0 <code>crontab -e<\/code> (s\u1eeda l\u1ecbch) v\u00e0 <code>crontab -l<\/code> (xem l\u1ecbch).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">B\u00e0i n\u00e0y d\u00e0nh cho ng\u01b0\u1eddi qu\u1ea3n tr\u1ecb VPS ho\u1eb7c m\u00e1y ch\u1ee7 Linux c\u00f3 quy\u1ec1n SSH. N\u1ebfu website c\u1ee7a b\u1ea1n n\u1eb1m tr\u00ean hosting cPanel, c\u00e1ch t\u1ea1o l\u1ecbch qua giao di\u1ec7n n\u1eb1m \u1edf b\u00e0i <a href=\"https:\/\/tino.vn\/blog\/cron-jobs-la-gi\/\">Cron Jobs l\u00e0 g\u00ec v\u00e0 c\u00e1ch t\u1ea1o tr\u00ean hosting<\/a>; c\u00e1c h\u01b0\u1edbng d\u1eabn qu\u1ea3n tr\u1ecb kh\u00e1c xem \u1edf <a href=\"https:\/\/tino.vn\/blog\/truy-cap-va-lay-thong-tin-hosting-tai-tino\/\">nh\u00f3m b\u00e0i qu\u1ea3n tr\u1ecb website tr\u00ean hosting<\/a>, kh\u00e1i ni\u1ec7m chung \u1edf <a href=\"https:\/\/tino.vn\/blog\/hosting-la-gi\/\">hosting l\u00e0 g\u00ec<\/a>.<\/p>\n\n\n\n<h2 id=\"Crontab_l\u00e0_g\u00ec?\">Crontab l\u00e0 g\u00ec?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Crontab l\u00e0 file v\u0103n b\u1ea3n ch\u1ee9a l\u1ecbch cron c\u1ee7a m\u1ed9t ng\u01b0\u1eddi d\u00f9ng; m\u1ed7i ng\u01b0\u1eddi d\u00f9ng c\u00f3 b\u1ea3ng ri\u00eang v\u00e0 l\u1ec7nh ch\u1ea1y v\u1edbi quy\u1ec1n c\u1ee7a ch\u00ednh ng\u01b0\u1eddi \u0111\u00f3 (<a href=\"https:\/\/manpages.ubuntu.com\/manpages\/noble\/man1\/crontab.1.html\" target=\"_blank\" rel=\"noopener nofollow\">man crontab(1)<\/a>). B\u1ea3ng n\u00e0y ch\u1ec9 l\u00e0 v\u0103n b\u1ea3n thu\u1ea7n, m\u1ed7i d\u00f2ng m\u1ed9t l\u1ecbch; ch\u01b0\u01a1ng tr\u00ecnh cron \u0111\u1ecdc n\u00f3 m\u1ed7i ph\u00fat, c\u00f2n l\u1ec7nh crontab l\u00e0 c\u00e1ch n\u00ean d\u00f9ng \u0111\u1ec3 s\u1eeda. C\u00e1c kh\u00e1i ni\u1ec7m \u0111i k\u00e8m:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>cron<\/strong>: daemon ch\u1ea1y n\u1ec1n, ki\u1ec3m tra l\u1ecbch m\u1ed7i ph\u00fat.<\/li>\n\n\n<li><strong>crontab<\/strong>: b\u1ea3ng l\u1ecbch v\u00e0 l\u1ec7nh qu\u1ea3n l\u00fd b\u1ea3ng.<\/li>\n\n\n<li><strong>cron job<\/strong>: m\u1ed9t d\u00f2ng l\u1ecbch trong b\u1ea3ng; kh\u00e1i ni\u1ec7m v\u00e0 v\u00ed d\u1ee5 chi ti\u1ebft \u1edf <a href=\"https:\/\/tino.vn\/blog\/cron-jobs-la-gi\/\">b\u00e0i Cron Jobs<\/a>.<\/li>\n<\/ul>\n\n\n\n<h2 id=\"Crontab_l\u01b0u_\u1edf_\u0111\u00e2u_v\u00e0_ho\u1ea1t_\u0111\u1ed9ng_ra_sao?\">Crontab l\u01b0u \u1edf \u0111\u00e2u v\u00e0 ho\u1ea1t \u0111\u1ed9ng ra sao?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Tr\u00ean Ubuntu\/Debian, crontab c\u1ee7a ng\u01b0\u1eddi d\u00f9ng n\u1eb1m trong <code>\/var\/spool\/cron\/crontabs\/<\/code>, nh\u01b0ng t\u00e0i li\u1ec7u ghi r\u00f5 c\u00e1c file n\u00e0y kh\u00f4ng d\u00f9ng \u0111\u1ec3 s\u1eeda tr\u1ef1c ti\u1ebfp; lu\u00f4n s\u1eeda qua l\u1ec7nh <code>crontab -e<\/code> \u0111\u1ec3 h\u1ec7 th\u1ed1ng ki\u1ec3m tra c\u00fa ph\u00e1p v\u00e0 n\u1ea1p l\u1ea1i. Ngo\u00e0i crontab c\u1ee7a t\u1eebng ng\u01b0\u1eddi d\u00f9ng, cron c\u00f2n \u0111\u1ecdc <code>\/etc\/crontab<\/code> v\u00e0 c\u00e1c file trong <code>\/etc\/cron.d\/<\/code>, l\u00e0 n\u01a1i c\u00f3 th\u00eam c\u1ed9t t\u00ean ng\u01b0\u1eddi d\u00f9ng (<a href=\"https:\/\/manpages.ubuntu.com\/manpages\/noble\/man8\/cron.8.html\" target=\"_blank\" rel=\"noopener nofollow\">man cron(8)<\/a>).<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"1400\" height=\"750\" src=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2026\/10\/crontab-la-gi-noi-luu-lich.webp\" alt=\"S\u01a1 \u0111\u1ed3 ba n\u01a1i ch\u1ee9a l\u1ecbch cron: crontab c\u1ee7a user s\u1eeda b\u1eb1ng crontab -e, \/etc\/crontab v\u00e0 \/etc\/cron.d c\u1ea7n sudo v\u00e0 c\u00f3 c\u1ed9t user, hosting cPanel t\u1ea1o l\u1ecbch trong m\u1ee5c Cron Jobs\" class=\"wp-image-132184\" title=\"\" srcset=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2026\/10\/crontab-la-gi-noi-luu-lich.webp 1400w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2026\/10\/crontab-la-gi-noi-luu-lich-300x161.webp 300w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2026\/10\/crontab-la-gi-noi-luu-lich-1024x549.webp 1024w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2026\/10\/crontab-la-gi-noi-luu-lich-768x411.webp 768w\" sizes=\"(max-width: 1400px) 100vw, 1400px\" \/><\/figure>\n\n\n\n<h2 id=\"C\u00e0i_\u0111\u1eb7t_cron_tr\u00ean_Ubuntu_24.04\">C\u00e0i \u0111\u1eb7t cron tr\u00ean Ubuntu 24.04<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Ph\u1ea7n l\u1edbn b\u1ea3n ph\u00e2n ph\u1ed1i Linux c\u00e0i s\u1eb5n cron, n\u00ean tr\u01b0\u1edbc khi c\u00e0i h\u00e3y ch\u1ea1y <code>systemctl status cron<\/code> \u0111\u1ec3 ki\u1ec3m tra. Tr\u00ean Ubuntu 24.04 LTS b\u1ea3n t\u1ed1i gi\u1ea3n (m\u1ed9t s\u1ed1 image VPS hay container) g\u00f3i cron c\u00f3 th\u1ec3 b\u1ecb l\u01b0\u1ee3c b\u1ecf; khi \u0111\u00f3 c\u00e0i v\u00e0 b\u1eadt d\u1ecbch v\u1ee5 b\u1eb1ng b\u1ed1n l\u1ec7nh sau:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt update\nsudo apt install cron\nsudo systemctl enable --now cron\nsystemctl status cron   # Active: active (running) l\u00e0 cron \u0111ang ch\u1ea1y<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><em>B\u00e0i c\u0169 h\u01b0\u1edbng d\u1eabn tr\u00ean Ubuntu 18.04, b\u1ea3n n\u00e0y \u0111\u00e3 h\u1ebft h\u1ed7 tr\u1ee3 ti\u00eau chu\u1ea9n. C\u00e1c l\u1ec7nh tr\u00ean gi\u1ed1ng nhau cho Ubuntu 22.04\/24.04 v\u00e0 Debian 12; tr\u00ean AlmaLinux\/Rocky, g\u00f3i t\u00ean l\u00e0 <code>cronie<\/code>, d\u1ecbch v\u1ee5 l\u00e0 <code>crond<\/code>.<\/em><\/p>\n\n\n\n<h2 id=\"C\u00e1c_l\u1ec7nh_crontab_c\u01a1_b\u1ea3n\">C\u00e1c l\u1ec7nh crontab c\u01a1 b\u1ea3n<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">C\u00e1c l\u1ec7nh crontab c\u01a1 b\u1ea3n g\u1ed3m s\u1eeda, xem, xo\u00e1 b\u1ea3ng l\u1ecbch v\u00e0 thao t\u00e1c v\u1edbi b\u1ea3ng c\u1ee7a ng\u01b0\u1eddi d\u00f9ng kh\u00e1c. L\u1ec7nh n\u00e0o c\u0169ng \u00e1p d\u1ee5ng cho ng\u01b0\u1eddi d\u00f9ng \u0111ang \u0111\u0103ng nh\u1eadp, tr\u1eeb khi th\u00eam <code>-u<\/code>. Ba l\u1ec7nh c\u1ea7n nh\u1edb l\u00e0 <code>-e<\/code> \u0111\u1ec3 s\u1eeda, <code>-l<\/code> \u0111\u1ec3 xem v\u00e0 <code>-i -r<\/code> \u0111\u1ec3 xo\u00e1 c\u00f3 h\u1ecfi l\u1ea1i.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>L\u1ec7nh<\/th><th>T\u00e1c d\u1ee5ng<\/th><th>L\u01b0u \u00fd<\/th><\/tr><\/thead><tbody><tr><td><code>crontab -e<\/code><\/td><td>M\u1edf b\u1ea3ng l\u1ecbch b\u1eb1ng tr\u00ecnh so\u1ea1n th\u1ea3o (bi\u1ebfn VISUAL\/EDITOR), l\u01b0u xong t\u1ef1 c\u00e0i<\/td><td>L\u1ea7n \u0111\u1ea7u Ubuntu h\u1ecfi ch\u1ecdn nano hay vim<\/td><\/tr><tr><td><code>crontab -l<\/code><\/td><td>In b\u1ea3ng l\u1ecbch hi\u1ec7n t\u1ea1i<\/td><td>N\u00ean ch\u1ea1y tr\u01b0\u1edbc khi s\u1eeda \u0111\u1ec3 bi\u1ebft \u0111ang c\u00f3 g\u00ec<\/td><\/tr><tr><td><code>crontab -r<\/code><\/td><td>Xo\u00e1 to\u00e0n b\u1ed9 b\u1ea3ng l\u1ecbch, kh\u00f4ng h\u1ecfi l\u1ea1i<\/td><td>Ph\u00edm r n\u1eb1m c\u1ea1nh e: g\u00f5 nh\u1ea7m l\u00e0 m\u1ea5t h\u1ebft l\u1ecbch<\/td><\/tr><tr><td><code>crontab -i -r<\/code><\/td><td>Xo\u00e1 nh\u01b0ng h\u1ecfi x\u00e1c nh\u1eadn y\/Y tr\u01b0\u1edbc<\/td><td>D\u00f9ng thay cho -r<\/td><\/tr><tr><td><code>sudo crontab -u t\u00ean -l<\/code><\/td><td>Xem b\u1ea3ng c\u1ee7a ng\u01b0\u1eddi d\u00f9ng kh\u00e1c<\/td><td>C\u1ea7n quy\u1ec1n root; -e, -r d\u00f9ng t\u01b0\u01a1ng t\u1ef1<\/td><\/tr><tr><td><code>crontab file.txt<\/code><\/td><td>Thay to\u00e0n b\u1ed9 b\u1ea3ng b\u1eb1ng n\u1ed9i dung file<\/td><td>Ghi \u0111\u00e8, kh\u00f4ng c\u1ed9ng th\u00eam<\/td><\/tr><\/tbody><\/table><figcaption class=\"wp-element-caption\">Theo <a href=\"https:\/\/manpages.ubuntu.com\/manpages\/noble\/man1\/crontab.1.html\" target=\"_blank\" rel=\"noopener nofollow\">man crontab(1), Ubuntu 24.04<\/a><\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"1400\" height=\"750\" src=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2026\/10\/crontab-la-gi-khi-luu-crontab-e.webp\" alt=\"S\u01a1 \u0111\u1ed3 \u0111i\u1ec1u x\u1ea3y ra khi l\u01b0u crontab -e: m\u1edf b\u1ea3n sao t\u1ea1m, l\u1ec7nh crontab ki\u1ec3m tra c\u00fa ph\u00e1p, sai th\u00ec h\u1ecfi s\u1eeda l\u1ea1i, \u0111\u00fang th\u00ec c\u00e0i v\u00e0o \/var\/spool\/cron\/crontabs\/&lt;user&gt;, cron n\u1ea1p l\u1ea1i \u1edf l\u1ea7n ki\u1ec3m tra m\u1ed7i ph\u00fat kh\u00f4ng c\u1ea7n restart, \u0111\u1ebfn gi\u1edd \/bin\/sh ch\u1ea1y l\u1ec7nh v\u00e0 g\u1eedi \u0111\u1ea7u ra qua MAILTO ho\u1eb7c log\" class=\"wp-image-132183\" title=\"\" srcset=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2026\/10\/crontab-la-gi-khi-luu-crontab-e.webp 1400w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2026\/10\/crontab-la-gi-khi-luu-crontab-e-300x161.webp 300w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2026\/10\/crontab-la-gi-khi-luu-crontab-e-1024x549.webp 1024w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2026\/10\/crontab-la-gi-khi-luu-crontab-e-768x411.webp 768w\" sizes=\"(max-width: 1400px) 100vw, 1400px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Tr\u01b0\u1edbc khi s\u1eeda l\u1edbn, sao l\u01b0u b\u1ea3ng l\u1ecbch \u0111\u1ec3 kh\u00f4i ph\u1ee5c \u0111\u01b0\u1ee3c khi l\u1ee1 tay:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>crontab -l &gt; ~\/crontab-$(date +%F).bak   # sao l\u01b0u\ncrontab ~\/crontab-2026-10-25.bak          # kh\u00f4i ph\u1ee5c t\u1eeb b\u1ea3n sao l\u01b0u<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Quy\u1ec1n d\u00f9ng l\u1ec7nh crontab c\u00f3 th\u1ec3 b\u1ecb gi\u1edbi h\u1ea1n: n\u1ebfu c\u00f3 file <code>\/etc\/cron.allow<\/code>, ch\u1ec9 ng\u01b0\u1eddi d\u00f9ng c\u00f3 t\u00ean trong \u0111\u00f3 \u0111\u01b0\u1ee3c d\u00f9ng; n\u1ebfu ch\u1ec9 c\u00f3 <code>\/etc\/cron.deny<\/code>, ng\u01b0\u1eddi d\u00f9ng b\u1ecb li\u1ec7t k\u00ea s\u1ebd b\u1ecb ch\u1eb7n.<\/p>\n\n\n\n<h2 id=\"C\u00e1ch_vi\u1ebft_m\u1ed9t_d\u00f2ng_crontab\">C\u00e1ch vi\u1ebft m\u1ed9t d\u00f2ng crontab<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">M\u1ed9t d\u00f2ng crontab c\u00f3 5 tr\u01b0\u1eddng th\u1eddi gian r\u1ed3i \u0111\u1ebfn l\u1ec7nh: ph\u00fat, gi\u1edd, ng\u00e0y trong th\u00e1ng, th\u00e1ng, th\u1ee9 trong tu\u1ea7n (<a href=\"https:\/\/manpages.ubuntu.com\/manpages\/noble\/man5\/crontab.5.html\" target=\"_blank\" rel=\"noopener nofollow\">man crontab(5)<\/a>). C\u00e1c tr\u01b0\u1eddng c\u00e1ch nhau b\u1eb1ng d\u1ea5u c\u00e1ch; ph\u1ea7n c\u00f2n l\u1ea1i c\u1ee7a d\u00f2ng sau tr\u01b0\u1eddng th\u1ee9 n\u0103m l\u00e0 l\u1ec7nh, \u0111\u01b0\u1ee3c ch\u1ea1y b\u1eb1ng \/bin\/sh. Gi\u00e1 tr\u1ecb cho ph\u00e9p c\u1ee7a t\u1eebng tr\u01b0\u1eddng:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Tr\u01b0\u1eddng<\/th><th>Gi\u00e1 tr\u1ecb cho ph\u00e9p<\/th><\/tr><\/thead><tbody><tr><td>Ph\u00fat<\/td><td>0\u201359<\/td><\/tr><tr><td>Gi\u1edd<\/td><td>0\u201323<\/td><\/tr><tr><td>Ng\u00e0y trong th\u00e1ng<\/td><td>1\u201331<\/td><\/tr><tr><td>Th\u00e1ng<\/td><td>1\u201312 ho\u1eb7c jan\u2013dec<\/td><\/tr><tr><td>Th\u1ee9 trong tu\u1ea7n<\/td><td>0\u20137 (0 v\u00e0 7 \u0111\u1ec1u l\u00e0 Ch\u1ee7 nh\u1eadt) ho\u1eb7c sun\u2013sat<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">V\u00ed d\u1ee5: sao l\u01b0u l\u00fac 0:00 ng\u00e0y 1 v\u00e0 ng\u00e0y 15 h\u1eb1ng th\u00e1ng:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>0 0 1,15 * * \/usr\/local\/bin\/backup.sh<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><em>M\u1ed9t l\u1ed7i hay g\u1eb7p l\u00e0 vi\u1ebft <code>0 0 1,15 * 3 * \/tino.org\/backup<\/code>: d\u00f2ng n\u00e0y th\u1eeba m\u1ed9t tr\u01b0\u1eddng n\u00ean cron b\u00e1o l\u1ed7i. Ngo\u00e0i ra, khi c\u1ea3 tr\u01b0\u1eddng ng\u00e0y v\u00e0 tr\u01b0\u1eddng th\u1ee9 c\u00f9ng b\u1ecb gi\u1edbi h\u1ea1n, cron ch\u1ea1y khi m\u1ed9t trong hai kh\u1edbp, n\u00ean <code>0 0 1,15 * 3<\/code> s\u1ebd ch\u1ea1y c\u1ea3 m\u1ecdi th\u1ee9 T\u01b0.<\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">M\u1ed9t s\u1ed1 v\u00ed d\u1ee5 kh\u00e1c:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>* * * * *<\/code>: ch\u1ea1y m\u1ed7i ph\u00fat.<\/li>\n\n\n<li><code>12 * * * *<\/code>: ch\u1ea1y \u1edf ph\u00fat 12 c\u1ee7a m\u1ed7i gi\u1edd.<\/li>\n\n\n<li><code>0,15,30,45 * * * *<\/code> ho\u1eb7c <code>*\/15 * * * *<\/code>: ch\u1ea1y m\u1ed7i 15 ph\u00fat.<\/li>\n\n\n<li><code>0 4 * * *<\/code>: ch\u1ea1y l\u00fac 4:00 s\u00e1ng m\u1ed7i ng\u00e0y.<\/li>\n\n\n<li><code>0 4 * * 2-4<\/code>: ch\u1ea1y l\u00fac 4:00 s\u00e1ng th\u1ee9 Ba, th\u1ee9 T\u01b0 v\u00e0 th\u1ee9 N\u0103m.<\/li>\n\n\n<li><code>20,40 *\/8 * 7-12 *<\/code>: ch\u1ea1y \u1edf ph\u00fat 20 v\u00e0 40 c\u1ee7a c\u00e1c gi\u1edd 0, 8, 16 (c\u1ee9 8 gi\u1edd m\u1ed9t l\u1ea7n), m\u1ed7i ng\u00e0y, t\u1eeb th\u00e1ng 7 \u0111\u1ebfn th\u00e1ng 12.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Lu\u00f4n vi\u1ebft \u0111\u01b0\u1eddng d\u1eabn \u0111\u1ea7y \u0111\u1ee7 cho l\u1ec7nh v\u00e0 file: cron ch\u1ea1y v\u1edbi bi\u1ebfn PATH r\u00fat g\u1ecdn, kh\u00f4ng \u0111\u1ecdc <code>.bashrc<\/code> c\u1ee7a b\u1ea1n. K\u00fd t\u1ef1 <code>%<\/code> trong l\u1ec7nh ph\u1ea3i vi\u1ebft <code>\\%<\/code>.<\/p>\n\n\n\n<h3 id=\"M\u1ed9t_s\u1ed1_c\u00fa_ph\u00e1p_\u0111\u1eb7c_bi\u1ec7t_trong_Crontab\">M\u1ed9t s\u1ed1 c\u00fa ph\u00e1p \u0111\u1eb7c bi\u1ec7t trong Crontab<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Crontab h\u1ed7 tr\u1ee3 c\u00e1c chu\u1ed7i vi\u1ebft t\u1eaft thay cho 5 tr\u01b0\u1eddng th\u1eddi gian:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Chu\u1ed7i vi\u1ebft t\u1eaft<\/th><th>T\u01b0\u01a1ng \u0111\u01b0\u01a1ng<\/th><\/tr><\/thead><tbody><tr><td><code>@hourly<\/code><\/td><td><code>0 * * * *<\/code><\/td><\/tr><tr><td><code>@daily<\/code><\/td><td><code>0 0 * * *<\/code><\/td><\/tr><tr><td><code>@weekly<\/code><\/td><td><code>0 0 * * 0<\/code><\/td><\/tr><tr><td><code>@monthly<\/code><\/td><td><code>0 0 1 * *<\/code><\/td><\/tr><tr><td><code>@yearly<\/code> \/ <code>@annually<\/code><\/td><td><code>0 0 1 1 *<\/code><\/td><\/tr><tr><td><code>@reboot<\/code><\/td><td>Ch\u1ea1y m\u1ed9t l\u1ea7n sau khi m\u00e1y kh\u1edfi \u0111\u1ed9ng<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 id=\"Qu\u1ea3n_l\u00fd_\u0111\u1ea7u_ra_v\u00e0_xem_log_c\u1ee7a_Crontab\">Qu\u1ea3n l\u00fd \u0111\u1ea7u ra v\u00e0 xem log c\u1ee7a Crontab<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Crontab g\u1eedi m\u1ecdi th\u1ee9 l\u1ec7nh in ra qua email cho ch\u1ee7 b\u1ea3ng l\u1ecbch, ho\u1eb7c cho \u0111\u1ecba ch\u1ec9 trong bi\u1ebfn <code>MAILTO<\/code>. M\u00e1y c\u1ea7n c\u00f3 d\u1ecbch v\u1ee5 g\u1eedi mail c\u1ee5c b\u1ed9 th\u00ec c\u00e1ch n\u00e0y m\u1edbi ho\u1ea1t \u0111\u1ed9ng; tr\u00ean VPS m\u1edbi c\u00e0i th\u01b0\u1eddng ch\u01b0a c\u00f3, n\u00ean ghi ra file log d\u1ec5 ki\u1ec3m so\u00e1t h\u01a1n:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>MAILTO=\"admin@tenmien.vn\"\n30 2 * * * \/usr\/local\/bin\/backup.sh &gt;&gt; \/var\/log\/backup-cron.log 2&gt;&amp;1\n\n# T\u1eaft email cho c\u1ea3 b\u1ea3ng\nMAILTO=\"\"<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u0110\u1ec3 bi\u1ebft cron \u0111\u00e3 g\u1ecdi l\u1ec7nh hay ch\u01b0a, xem log c\u1ee7a d\u1ecbch v\u1ee5 cron:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>journalctl -u cron --since today\n# ho\u1eb7c, n\u1ebfu m\u00e1y d\u00f9ng rsyslog:\ngrep CRON \/var\/log\/syslog | tail -n 20<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><em>M\u1ed9t l\u1ed7i hay g\u1eb7p kh\u00e1c l\u00e0 vi\u1ebft <code>MAILTO=\u201dthunghiem@tino.org\u201d<\/code> v\u1edbi d\u1ea5u ngo\u1eb7c k\u00e9p cong; cron ch\u1ec9 hi\u1ec3u ngo\u1eb7c k\u00e9p th\u1eb3ng <code>\"<\/code>. L\u1ed7i n\u00e0y hay g\u1eb7p khi ch\u00e9p l\u1ec7nh t\u1eeb trang web ho\u1eb7c file Word.<\/em><\/p>\n\n\n\n<h2 id=\"C\u00e1ch_t\u1ea1o_l\u1ec7nh_Crontab_nhanh_b\u1eb1ng_Crontab_Guru\">C\u00e1ch t\u1ea1o l\u1ec7nh Crontab nhanh b\u1eb1ng Crontab Guru<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/crontab.guru\/\" target=\"_blank\" rel=\"noopener nofollow\">Crontab guru<\/a> l\u00e0 trang nh\u1eadp bi\u1ec3u th\u1ee9c cron v\u00e0 tr\u1ea3 v\u1ec1 c\u00e2u m\u00f4 t\u1ea3 b\u1eb1ng ti\u1ebfng Anh k\u00e8m c\u00e1c l\u1ea7n ch\u1ea1y ti\u1ebfp theo, gi\u00fap b\u1ea1n b\u1eaft l\u1ed7i l\u1ecbch tr\u01b0\u1edbc khi \u0111\u01b0a l\u00ean m\u00e1y ch\u1ee7. Trang d\u00f9ng c\u00fa ph\u00e1p 5 tr\u01b0\u1eddng gi\u1ed1ng crontab Linux. V\u00ed d\u1ee5, mu\u1ed1n ch\u1ea1y l\u00fac 22:00 t\u1eeb th\u1ee9 Hai \u0111\u1ebfn th\u1ee9 S\u00e1u:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>0 22 * * 1-5<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Trang ch\u1ec9 ki\u1ec3m c\u00fa ph\u00e1p th\u1eddi gian; l\u1ec7nh ph\u00eda sau v\u1eabn c\u1ea7n b\u1ea1n ch\u1ea1y th\u1eed b\u1eb1ng tay tr\u00ean m\u00e1y ch\u1ee7 tr\u01b0\u1edbc khi \u0111\u01b0a v\u00e0o crontab.<\/p>\n\n\n\n<h2 id=\"Khi_n\u00e0o_kh\u00f4ng_n\u00ean_d\u00f9ng_crontab?\">Khi n\u00e0o kh\u00f4ng n\u00ean d\u00f9ng crontab?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Crontab h\u1ee3p v\u1edbi vi\u1ec7c b\u1ea3o tr\u00ec \u0111\u1ecbnh k\u1ef3 tr\u00ean m\u00e1y b\u1ea1n c\u00f3 quy\u1ec1n SSH. Ba tr\u01b0\u1eddng h\u1ee3p d\u01b0\u1edbi \u0111\u00e2y n\u00ean ch\u1ecdn c\u00f4ng c\u1ee5 kh\u00e1c, v\u00ec crontab kh\u00f4ng ch\u1ea1y d\u00e0y h\u01a1n 1 ph\u00fat, c\u1ea7n quy\u1ec1n tr\u00ean m\u00e1y ch\u1ee7 v\u00e0 d\u1ec5 tr\u00f9ng v\u1edbi b\u1ed9 h\u1eb9n gi\u1edd c\u00f3 s\u1eb5n c\u1ee7a \u1ee9ng d\u1ee5ng:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>T\u00e1c v\u1ee5 c\u1ea7n ch\u1ea1y li\u00ean t\u1ee5c ho\u1eb7c d\u00e0y h\u01a1n 1 ph\u00fat: d\u00f9ng d\u1ecbch v\u1ee5 systemd (ho\u1eb7c systemd timer) thay cho v\u00f2ng l\u1eb7p trong cron.<\/li>\n\n\n<li>Website tr\u00ean shared hosting: kh\u00f4ng c\u00f3 quy\u1ec1n root, h\u00e3y t\u1ea1o l\u1ecbch trong m\u1ee5c Cron Jobs c\u1ee7a cPanel.<\/li>\n\n\n<li>L\u1ecbch n\u1eb1m trong \u1ee9ng d\u1ee5ng \u0111\u00e3 c\u00f3 b\u1ed9 h\u1eb9n gi\u1edd ri\u00eang (v\u00ed d\u1ee5 automation c\u1ee7a OpenClaw): xem <a href=\"https:\/\/tino.vn\/blog\/chuyen-tu-cron-cu-sang-automations-trong-openclaw\/\">chuy\u1ec3n t\u1eeb cron c\u0169 sang automations trong OpenClaw<\/a> tr\u01b0\u1edbc khi th\u00eam cron h\u1ec7 th\u1ed1ng.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">D\u00f9ng crontab cho vi\u1ec7c b\u1ea3o tr\u00ec VPS nh\u01b0 sao l\u01b0u, gia h\u1ea1n ch\u1ee9ng ch\u1ec9, d\u1ecdn log l\u00e0 ph\u00f9 h\u1ee3p. C\u00e1c vi\u1ec7c qu\u1ea3n tr\u1ecb VPS kh\u00e1c xem \u1edf <a href=\"https:\/\/tino.vn\/blog\/cach-su-dung-vps\/\">c\u00e1ch s\u1eed d\u1ee5ng VPS<\/a> v\u00e0 <a href=\"https:\/\/tino.vn\/blog\/backup-vps\/\">backup VPS<\/a>.<\/p>\n\n\n\n<h2 id=\"K\u1ebft_lu\u1eadn\">K\u1ebft lu\u1eadn<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Crontab l\u00e0 c\u00f4ng c\u1ee5 g\u1ecdn \u0111\u1ec3 m\u00e1y ch\u1ee7 Linux t\u1ef1 l\u00e0m vi\u1ec7c \u0111\u1ecbnh k\u1ef3. Ghi nh\u1edb <code>crontab -e<\/code> \u0111\u1ec3 s\u1eeda, <code>crontab -l<\/code> \u0111\u1ec3 xem, tr\u00e1nh <code>crontab -r<\/code>, lu\u00f4n d\u00f9ng \u0111\u01b0\u1eddng d\u1eabn \u0111\u1ea7y \u0111\u1ee7 v\u00e0 ghi \u0111\u1ea7u ra v\u00e0o log l\u00e0 \u0111\u1ee7 \u0111\u1ec3 v\u1eadn h\u00e0nh \u1ed5n \u0111\u1ecbnh.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">C\u1ea7n hosting \u1ed5n \u0111\u1ecbnh cho website? <a href=\"https:\/\/tino.vn\/hosting-gia-re\">Hosting c\u1ee7a Tino<\/a> d\u00f9ng \u1ed5 NVMe, LiteSpeed v\u00e0 cPanel \u0111\u1ec3 b\u1ea1n t\u1ef1 qu\u1ea3n tr\u1ecb. Xem c\u1ea5u h\u00ecnh v\u00e0 gi\u00e1 tr\u00ean trang s\u1ea3n ph\u1ea9m.<\/p>\n<\/blockquote>\n\n\n\n<h2 id=\"Nh\u1eefng_c\u00e2u_h\u1ecfi_th\u01b0\u1eddng_g\u1eb7p_v\u1ec1_Crontab\">Nh\u1eefng c\u00e2u h\u1ecfi th\u01b0\u1eddng g\u1eb7p v\u1ec1 Crontab<\/h2>\n\n\n\t\t<section\t\thelp class=\"sc_fs_faq sc_card    \"\n\t\t\t\t>\n\t\t\t\t<h2 id=\"Hosting_c\u1ee7a_Tino_c\u00f3_d\u00f9ng_\u0111\u01b0\u1ee3c_crontab_kh\u00f4ng?\">Hosting c\u1ee7a Tino c\u00f3 d\u00f9ng \u0111\u01b0\u1ee3c crontab kh\u00f4ng?<\/h2>\t\t\t\t<div>\n\t\t\t\t\t\t<div class=\"sc_fs_faq__content\">\n\t\t\t\t\n\n<p class=\"wp-block-paragraph\">C\u00f3, qua m\u1ee5c Cron Jobs trong cPanel (nh\u00f3m Advanced) khi g\u00f3i hosting b\u1eadt t\u00ednh n\u0103ng n\u00e0y: b\u1ea1n t\u1ea1o l\u1ecbch b\u1eb1ng giao di\u1ec7n, kh\u00f4ng c\u1ea7n g\u00f5 l\u1ec7nh crontab. C\u00e1c b\u01b0\u1edbc v\u00e0 \u1ea3nh ch\u1ee5p xem \u1edf b\u00e0i <a href=\"https:\/\/tino.vn\/blog\/cron-jobs-la-gi\/\">Cron Jobs l\u00e0 g\u00ec<\/a>.<\/p>\n\n\t\t\t<\/div>\n\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section\t\thelp class=\"sc_fs_faq sc_card    \"\n\t\t\t\t>\n\t\t\t\t<h2 id=\"L\u1ee1_ch\u1ea1y_crontab_-r_th\u00ec_kh\u00f4i_ph\u1ee5c_th\u1ebf_n\u00e0o?\">L\u1ee1 ch\u1ea1y crontab -r th\u00ec kh\u00f4i ph\u1ee5c th\u1ebf n\u00e0o?<\/h2>\t\t\t\t<div>\n\t\t\t\t\t\t<div class=\"sc_fs_faq__content\">\n\t\t\t\t\n\n<p class=\"wp-block-paragraph\">L\u1ec7nh n\u00e0y xo\u00e1 h\u1eb3n b\u1ea3ng l\u1ecbch, kh\u00f4ng c\u00f3 th\u00f9ng r\u00e1c. N\u1ebfu \u0111\u00e3 sao l\u01b0u b\u1eb1ng <code>crontab -l &gt; file<\/code>, ch\u1ea1y <code>crontab file<\/code> \u0111\u1ec3 n\u1ea1p l\u1ea1i; n\u1ebfu ch\u01b0a, ph\u1ea3i vi\u1ebft l\u1ea1i t\u1eeb \u0111\u1ea7u, v\u00ec v\u1eady n\u00ean sao l\u01b0u tr\u01b0\u1edbc m\u1ed7i l\u1ea7n s\u1eeda.<\/p>\n\n\t\t\t<\/div>\n\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section\t\thelp class=\"sc_fs_faq sc_card    \"\n\t\t\t\t>\n\t\t\t\t<h2 id=\"S\u1eeda_crontab_xong_c\u00f3_c\u1ea7n_kh\u1edfi_\u0111\u1ed9ng_l\u1ea1i_cron_kh\u00f4ng?\">S\u1eeda crontab xong c\u00f3 c\u1ea7n kh\u1edfi \u0111\u1ed9ng l\u1ea1i cron kh\u00f4ng?<\/h2>\t\t\t\t<div>\n\t\t\t\t\t\t<div class=\"sc_fs_faq__content\">\n\t\t\t\t\n\n<p class=\"wp-block-paragraph\">Kh\u00f4ng. Khi l\u01b0u b\u1eb1ng <code>crontab -e<\/code>, b\u1ea3ng l\u1ecbch m\u1edbi \u0111\u01b0\u1ee3c c\u00e0i ngay v\u00e0 cron t\u1ef1 nh\u1eadn thay \u0111\u1ed5i \u1edf l\u1ea7n ki\u1ec3m tra ti\u1ebfp theo.<\/p>\n\n\t\t\t<\/div>\n\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section\t\thelp class=\"sc_fs_faq sc_card    \"\n\t\t\t\t>\n\t\t\t\t<h2 id=\"sudo_crontab_-e_kh\u00e1c_crontab_-e_th\u1ebf_n\u00e0o?\">sudo crontab -e kh\u00e1c crontab -e th\u1ebf n\u00e0o?<\/h2>\t\t\t\t<div>\n\t\t\t\t\t\t<div class=\"sc_fs_faq__content\">\n\t\t\t\t\n\n<p class=\"wp-block-paragraph\"><code>sudo crontab -e<\/code> s\u1eeda b\u1ea3ng l\u1ecbch c\u1ee7a root, l\u1ec7nh ch\u1ea1y v\u1edbi quy\u1ec1n root. <code>crontab -e<\/code> s\u1eeda b\u1ea3ng c\u1ee7a ng\u01b0\u1eddi d\u00f9ng hi\u1ec7n t\u1ea1i. Ch\u1ec9 \u0111\u1eb7t v\u00e0o b\u1ea3ng root nh\u1eefng vi\u1ec7c th\u1eadt s\u1ef1 c\u1ea7n quy\u1ec1n root.<\/p>\n\n\t\t\t<\/div>\n\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section\t\thelp class=\"sc_fs_faq sc_card    \"\n\t\t\t\t>\n\t\t\t\t<h2 id=\"Ch\u1ea1y_crontab_-l_b\u00e1o_\u201cno_crontab_for_user\u201d_l\u00e0_l\u1ed7i_g\u00ec?\">Ch\u1ea1y crontab -l b\u00e1o \u201cno crontab for user\u201d l\u00e0 l\u1ed7i g\u00ec?<\/h2>\t\t\t\t<div>\n\t\t\t\t\t\t<div class=\"sc_fs_faq__content\">\n\t\t\t\t\n\n<p class=\"wp-block-paragraph\">Kh\u00f4ng ph\u1ea3i l\u1ed7i: ng\u01b0\u1eddi d\u00f9ng \u0111\u00f3 ch\u01b0a c\u00f3 b\u1ea3ng l\u1ecbch n\u00e0o. Ch\u1ea1y <code>crontab -e<\/code>, th\u00eam d\u00f2ng l\u1ecbch r\u1ed3i l\u01b0u l\u00e0 b\u1ea3ng \u0111\u01b0\u1ee3c t\u1ea1o. N\u1ebfu b\u1ea1n ch\u1eafc \u0111\u00e3 t\u1ea1o l\u1ecbch, ki\u1ec3m tra c\u00f3 \u0111ang \u0111\u0103ng nh\u1eadp \u0111\u00fang user kh\u00f4ng, v\u00ec <code>sudo crontab -l<\/code> ch\u1ec9 hi\u1ec7n b\u1ea3ng c\u1ee7a root.<\/p>\n\n\t\t\t<\/div>\n\t\t<\/div>\n\t\t<\/section>\n\t\t\n<script type=\"application\/ld+json\">\n\t{\n\t\t\"@context\": \"https:\/\/schema.org\",\n\t\t\"@type\": \"FAQPage\",\n\t\t\"mainEntity\": [\n\t\t\t\t\t{\n\t\t\t\t\"@type\": \"Question\",\n\t\t\t\t\"name\": \"Hosting c\u1ee7a Tino c\u00f3 d\u00f9ng \u0111\u01b0\u1ee3c crontab kh\u00f4ng?\",\n\t\t\t\t\"acceptedAnswer\": {\n\t\t\t\t\t\"@type\": \"Answer\",\n\t\t\t\t\t\"text\": \"<p>C\u00f3, qua m\u1ee5c Cron Jobs trong cPanel (nh\u00f3m Advanced) khi g\u00f3i hosting b\u1eadt t\u00ednh n\u0103ng n\u00e0y: b\u1ea1n t\u1ea1o l\u1ecbch b\u1eb1ng giao di\u1ec7n, kh\u00f4ng c\u1ea7n g\u00f5 l\u1ec7nh crontab. C\u00e1c b\u01b0\u1edbc v\u00e0 \u1ea3nh ch\u1ee5p xem \u1edf b\u00e0i <a>Cron Jobs l\u00e0 g\u00ec<\/a>.<\/p>\"\n\t\t\t\t\t\t\t\t\t}\n\t\t\t}\n\t\t\t,\t\t\t\t{\n\t\t\t\t\"@type\": \"Question\",\n\t\t\t\t\"name\": \"L\u1ee1 ch\u1ea1y crontab -r th\u00ec kh\u00f4i ph\u1ee5c th\u1ebf n\u00e0o?\",\n\t\t\t\t\"acceptedAnswer\": {\n\t\t\t\t\t\"@type\": \"Answer\",\n\t\t\t\t\t\"text\": \"<p>L\u1ec7nh n\u00e0y xo\u00e1 h\u1eb3n b\u1ea3ng l\u1ecbch, kh\u00f4ng c\u00f3 th\u00f9ng r\u00e1c. N\u1ebfu \u0111\u00e3 sao l\u01b0u b\u1eb1ng crontab -l &gt; file, ch\u1ea1y crontab file \u0111\u1ec3 n\u1ea1p l\u1ea1i; n\u1ebfu ch\u01b0a, ph\u1ea3i vi\u1ebft l\u1ea1i t\u1eeb \u0111\u1ea7u, v\u00ec v\u1eady n\u00ean sao l\u01b0u tr\u01b0\u1edbc m\u1ed7i l\u1ea7n s\u1eeda.<\/p>\"\n\t\t\t\t\t\t\t\t\t}\n\t\t\t}\n\t\t\t,\t\t\t\t{\n\t\t\t\t\"@type\": \"Question\",\n\t\t\t\t\"name\": \"S\u1eeda crontab xong c\u00f3 c\u1ea7n kh\u1edfi \u0111\u1ed9ng l\u1ea1i cron kh\u00f4ng?\",\n\t\t\t\t\"acceptedAnswer\": {\n\t\t\t\t\t\"@type\": \"Answer\",\n\t\t\t\t\t\"text\": \"<p>Kh\u00f4ng. Khi l\u01b0u b\u1eb1ng crontab -e, b\u1ea3ng l\u1ecbch m\u1edbi \u0111\u01b0\u1ee3c c\u00e0i ngay v\u00e0 cron t\u1ef1 nh\u1eadn thay \u0111\u1ed5i \u1edf l\u1ea7n ki\u1ec3m tra ti\u1ebfp theo.<\/p>\"\n\t\t\t\t\t\t\t\t\t}\n\t\t\t}\n\t\t\t,\t\t\t\t{\n\t\t\t\t\"@type\": \"Question\",\n\t\t\t\t\"name\": \"sudo crontab -e kh\u00e1c crontab -e th\u1ebf n\u00e0o?\",\n\t\t\t\t\"acceptedAnswer\": {\n\t\t\t\t\t\"@type\": \"Answer\",\n\t\t\t\t\t\"text\": \"<p>sudo crontab -e s\u1eeda b\u1ea3ng l\u1ecbch c\u1ee7a root, l\u1ec7nh ch\u1ea1y v\u1edbi quy\u1ec1n root. crontab -e s\u1eeda b\u1ea3ng c\u1ee7a ng\u01b0\u1eddi d\u00f9ng hi\u1ec7n t\u1ea1i. Ch\u1ec9 \u0111\u1eb7t v\u00e0o b\u1ea3ng root nh\u1eefng vi\u1ec7c th\u1eadt s\u1ef1 c\u1ea7n quy\u1ec1n root.<\/p>\"\n\t\t\t\t\t\t\t\t\t}\n\t\t\t}\n\t\t\t,\t\t\t\t{\n\t\t\t\t\"@type\": \"Question\",\n\t\t\t\t\"name\": \"Ch\u1ea1y crontab -l b\u00e1o \u201cno crontab for user\u201d l\u00e0 l\u1ed7i g\u00ec?\",\n\t\t\t\t\"acceptedAnswer\": {\n\t\t\t\t\t\"@type\": \"Answer\",\n\t\t\t\t\t\"text\": \"<p>Kh\u00f4ng ph\u1ea3i l\u1ed7i: ng\u01b0\u1eddi d\u00f9ng \u0111\u00f3 ch\u01b0a c\u00f3 b\u1ea3ng l\u1ecbch n\u00e0o. Ch\u1ea1y crontab -e, th\u00eam d\u00f2ng l\u1ecbch r\u1ed3i l\u01b0u l\u00e0 b\u1ea3ng \u0111\u01b0\u1ee3c t\u1ea1o. N\u1ebfu b\u1ea1n ch\u1eafc \u0111\u00e3 t\u1ea1o l\u1ecbch, ki\u1ec3m tra c\u00f3 \u0111ang \u0111\u0103ng nh\u1eadp \u0111\u00fang user kh\u00f4ng, v\u00ec sudo crontab -l ch\u1ec9 hi\u1ec7n b\u1ea3ng c\u1ee7a root.<\/p>\"\n\t\t\t\t\t\t\t\t\t}\n\t\t\t}\n\t\t\t\t\t\t]\n\t}\n<\/script>\n","protected":false},"excerpt":{"rendered":"<p>Crontab (cron table) l\u00e0 b\u1ea3ng l\u1ecbch c\u1ee7a t\u1eebng ng\u01b0\u1eddi d\u00f9ng tr\u00ean Linux, m\u1ed7i d\u00f2ng g\u1ed3m 5 tr\u01b0\u1eddng th\u1eddi gian v\u00e0 m\u1ed9t l\u1ec7nh; crontab c\u0169ng l\u00e0 t\u00ean l\u1ec7nh \u0111\u1ec3 xem, s\u1eeda, xo\u00e1 b\u1ea3ng \u0111\u00f3. Ch\u01b0\u01a1ng tr\u00ecnh ch\u1ea1y n\u1ec1n cron \u0111\u1ecdc c\u00e1c b\u1ea3ng n\u00e0y m\u1ed7i ph\u00fat v\u00e0 th\u1ef1c thi l\u1ec7nh \u0111\u1ebfn gi\u1edd. Hai l\u1ec7nh d\u00f9ng th\u01b0\u1eddng xuy\u00ean [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":132127,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7726],"tags":[6187],"class_list":["post-43870","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-hosting","tag-ho-tro-developer"],"_links":{"self":[{"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/posts\/43870","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/comments?post=43870"}],"version-history":[{"count":2,"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/posts\/43870\/revisions"}],"predecessor-version":[{"id":132274,"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/posts\/43870\/revisions\/132274"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/media\/132127"}],"wp:attachment":[{"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/media?parent=43870"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/categories?post=43870"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/tags?post=43870"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}