{"id":1818,"date":"2025-10-31T04:54:47","date_gmt":"2025-10-31T04:54:47","guid":{"rendered":"https:\/\/alexisiumus.ru\/?p=1818"},"modified":"2025-10-31T05:21:15","modified_gmt":"2025-10-31T05:21:15","slug":"%d0%ba%d0%b0%d0%ba-%d0%bf%d1%80%d0%be%d0%b2%d0%b5%d1%80%d0%b8%d1%82%d1%8c-%d0%b7%d0%b0%d0%bf%d0%b8%d1%81%d0%b8-cron-%d0%b2-linux","status":"publish","type":"post","link":"https:\/\/alexisiumus.ru\/?p=1818","title":{"rendered":"\u041a\u0430\u043a \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0437\u0430\u043f\u0438\u0441\u0438 cron \u0432 Linux"},"content":{"rendered":"\n<p>\u0412 Debian 12 (\u043a\u0430\u043a \u0438 \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432\u0430\u0445 Linux), \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0437\u0430\u043f\u0438\u0441\u0438 cron (\u0437\u0430\u0434\u0430\u043d\u0438\u044f cron) \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438, \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u043e\u0433\u043e, \u0434\u043b\u044f \u043a\u0430\u043a\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438\u043b\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c. \u0412\u043e\u0442 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b:<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83e\uddcd \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 crontab \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>crontab -l<\/code><\/pre>\n\n\n\n<p>\u041f\u043e\u043a\u0430\u0436\u0435\u0442 \u0432\u0441\u0435 \u0437\u0430\u0434\u0430\u043d\u0438\u044f cron, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udc64 \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 crontab \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo crontab -u \u0438\u043c\u044f_\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f -l<\/code><\/pre>\n\n\n\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo crontab -u www-data -l<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udcc1 \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0445 crontab-\u0444\u0430\u0439\u043b\u043e\u0432<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">1. <strong>\u0424\u0430\u0439\u043b <code>\/etc\/crontab<\/code><\/strong><\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>cat \/etc\/crontab<\/code><\/pre>\n\n\n\n<p>\u042d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b \u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0437\u0430\u0434\u0430\u043d\u0438\u044f cron, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0435 \u043e\u0442 \u0438\u043c\u0435\u043d\u0438 \u0440\u0430\u0437\u043d\u044b\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439. \u0424\u043e\u0440\u043c\u0430\u0442 \u0441\u0442\u0440\u043e\u043a:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\u043c\u0438\u043d\u0443\u0442\u044b \u0447\u0430\u0441\u044b \u0434\u0435\u043d\u044c_\u043c\u0435\u0441\u044f\u0446\u0430 \u043c\u0435\u0441\u044f\u0446 \u0434\u0435\u043d\u044c_\u043d\u0435\u0434\u0435\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0430<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">2. <strong>\u041a\u0430\u0442\u0430\u043b\u043e\u0433\u0438 <code>\/etc\/cron.*<\/code><\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>\/etc\/cron.hourly\/<\/code><\/li>\n\n\n\n<li><code>\/etc\/cron.daily\/<\/code><\/li>\n\n\n\n<li><code>\/etc\/cron.weekly\/<\/code><\/li>\n\n\n\n<li><code>\/etc\/cron.monthly\/<\/code><\/li>\n<\/ul>\n\n\n\n<p>\u0421\u043a\u0440\u0438\u043f\u0442\u044b, \u043f\u043e\u043c\u0435\u0449\u0451\u043d\u043d\u044b\u0435 \u0432 \u044d\u0442\u0438 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0438, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ls -l \/etc\/cron.daily\/<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udd0d \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0432\u0441\u0435\u0445 crontab-\u0444\u0430\u0439\u043b\u043e\u0432 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435<\/h3>\n\n\n\n<p>\u0427\u0442\u043e\u0431\u044b \u043d\u0430\u0439\u0442\u0438 \u0432\u0441\u0435 crontab-\u0444\u0430\u0439\u043b\u044b:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo find \/var\/spool\/cron\/crontabs -type f<\/code><\/pre>\n\n\n\n<p>\u0418\u043b\u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0432\u0441\u0435\u0445 crontab-\u0444\u0430\u0439\u043b\u043e\u0432:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo grep -r '' \/var\/spool\/cron\/crontabs<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udcdc \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043b\u043e\u0433\u043e\u0432 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f cron<\/h3>\n\n\n\n<p>\u0415\u0441\u043b\u0438 \u0432\u043a\u043b\u044e\u0447\u0451\u043d \u043b\u043e\u0433 <code>cron<\/code>, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c, \u043a\u0430\u043a\u0438\u0435 \u0437\u0430\u0434\u0430\u043d\u0438\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b\u0438\u0441\u044c:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>grep CRON \/var\/log\/syslog<\/code><\/pre>\n\n\n\n<p>\u0418\u043b\u0438, \u0435\u0441\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f <code>rsyslog<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>journalctl -u cron<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p><strong>\u041f\u0440\u0438\u043c\u0435\u0440:<\/strong><\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>\u041a\u043e\u0433\u0434\u0430 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u044d\u0442\u043e \u0437\u0430\u0434\u0430\u043d\u0438\u0435 &#171;0 9 * * * \/home\/alex\/create_daily_note.sh&#187;<\/p>\n<\/blockquote>\n\n\n\n<p>\u0417\u0430\u0434\u0430\u043d\u0438\u0435 cron \u0441 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435\u043c <code>0 9 * * * \/home\/alex\/create_daily_note.sh<\/code> \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f <strong>\u043a\u0430\u0436\u0434\u044b\u0439 \u0434\u0435\u043d\u044c \u0432 9:00 \u0443\u0442\u0440\u0430<\/strong>.<\/p>\n\n\n\n<p>\ud83d\udd0d \u0420\u0430\u0441\u0448\u0438\u0444\u0440\u043e\u0432\u043a\u0430 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u043c\u0438\u043d\u0443\u0442\u0430 (0)\n\u2502 \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u0447\u0430\u0441 (9)\n\u2502 \u2502 \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u0434\u0435\u043d\u044c \u043c\u0435\u0441\u044f\u0446\u0430 (* \u2014 \u043b\u044e\u0431\u043e\u0439)\n\u2502 \u2502 \u2502 \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u043c\u0435\u0441\u044f\u0446 (* \u2014 \u043b\u044e\u0431\u043e\u0439)\n\u2502 \u2502 \u2502 \u2502 \u250c\u2500\u2500\u2500\u2500\u2500 \u0434\u0435\u043d\u044c \u043d\u0435\u0434\u0435\u043b\u0438 (* \u2014 \u043b\u044e\u0431\u043e\u0439)\n\u2502 \u2502 \u2502 \u2502 \u2502\n\u2502 \u2502 \u2502 \u2502 \u2502\n0 9 * * * \/home\/alex\/create_daily_note.sh\n<\/code><\/pre>\n\n\n\n<p>\ud83d\udcc5 \u042d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u0441\u043a\u0440\u0438\u043f\u0442 <code>create_daily_note.sh<\/code>, \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0439 \u0432 <code>\/home\/alex\/<\/code>, \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c\u0441\u044f <strong>\u0435\u0436\u0435\u0434\u043d\u0435\u0432\u043d\u043e \u0432 9:00 \u043f\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u043c\u0443 \u0432\u0440\u0435\u043c\u0435\u043d\u0438<\/strong>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0418\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u043f\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0435 \u0437\u0430\u0434\u0430\u043d\u0438\u0439 cron \u0432 Debian 12 (Linux): \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440 crontab \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439, \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0445 cron-\u0444\u0430\u0439\u043b\u043e\u0432, \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u043e\u0432 \/etc\/cron.*, \u043b\u043e\u0433\u043e\u0432 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044f \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0449\u0438\u043a\u0430 \u0437\u0430\u0434\u0430\u0447.<\/p>\n","protected":false},"author":1,"featured_media":1819,"comment_status":"open","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"footnotes":""},"categories":[33],"tags":[40,42,45,38,56,54,53,46,57,47,55,39,44,13,50,49,48,41,51,43,52],"class_list":{"0":"post-1818","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","6":"hentry","7":"category-33","8":"tag-etc-cron-daily","9":"tag-etc-crontab","10":"tag-var-spool-cron","11":"tag-cron","12":"tag-cron-","19":"tag-crontab","20":"tag-debian-12","21":"tag-linux","22":"tag-50","23":"tag-49","24":"tag--cron","25":"tag-41","26":"tag-51","27":"tag-43","28":"tag-52"},"_links":{"self":[{"href":"https:\/\/alexisiumus.ru\/index.php?rest_route=\/wp\/v2\/posts\/1818","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/alexisiumus.ru\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/alexisiumus.ru\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/alexisiumus.ru\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/alexisiumus.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1818"}],"version-history":[{"count":3,"href":"https:\/\/alexisiumus.ru\/index.php?rest_route=\/wp\/v2\/posts\/1818\/revisions"}],"predecessor-version":[{"id":1825,"href":"https:\/\/alexisiumus.ru\/index.php?rest_route=\/wp\/v2\/posts\/1818\/revisions\/1825"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/alexisiumus.ru\/index.php?rest_route=\/wp\/v2\/media\/1819"}],"wp:attachment":[{"href":"https:\/\/alexisiumus.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1818"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/alexisiumus.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1818"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/alexisiumus.ru\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1818"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}