{"id":190728,"date":"2013-08-20T16:40:04","date_gmt":"2013-08-20T12:40:04","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=190728"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=190728","title":{"rendered":"<span class=\"post_title\">Web-Interface \u0434\u043b\u044f Motion<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t\u041f\u043e\u0441\u043b\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0432\u0438\u0434\u0435\u043e\u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043f\u043e\u0434 debian, \u0431\u044b\u043b\u043e \u043f\u0440\u0438\u043d\u044f\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0432\u0438\u0434\u0435\u043e\u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u044f.<br \/>  Motion \u0431\u044b\u043b\u043e \u0440\u0435\u0448\u0435\u043d\u043e \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c, \u043d\u043e \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0432 \u0431\u043e\u043b\u0435\u0435 \u0447\u0435\u043b\u043e\u0432\u0435\u0447\u0435\u0441\u043a\u043e\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0435 \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0430 \u0430\u0440\u0445\u0438\u0432\u043d\u044b\u0445 \u0437\u0430\u043f\u0438\u0441\u0435\u0439.<br \/>  \u041e\u0447\u0435\u0440\u0435\u0434\u043d\u044b\u0435 \u043f\u043e\u0438\u0441\u043a\u0438 \u0432 \u0418\u043d\u0442\u0435\u0440\u043d\u0435\u0442 \u0442\u0430\u043a \u0438 \u043d\u0435 \u0434\u0430\u043b\u0438 \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u043f\u0440\u0438\u0435\u043c\u043b\u0435\u043c\u044b\u0445 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432, \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0447\u0435\u0433\u043e \u0431\u044b\u043b\u043e \u043f\u0440\u0438\u043d\u044f\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0430.<br \/>  \u041f\u043e\u0441\u043b\u0435 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043a\u043e\u043b\u0435\u0431\u0430\u043d\u0438\u0439, \u0432\u044b\u0431\u043e\u0440 \u043f\u0430\u043b \u043d\u0430 Rails. \u041d\u0438\u043a\u0430\u043a\u043e\u0439 \u0440\u0435\u043b\u0438\u0433\u0438\u0438, \u043f\u0440\u043e\u0441\u0442\u043e \u0437\u0430\u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u043f\u043e\u043b\u0443\u0447\u0448\u0435 \u0438\u0437\u0443\u0447\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u0438 \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u044f\u0437\u044b\u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0421\u0423\u0411\u0414 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f PostgreSQL.<br \/>  \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c&#8230;<a name=\"habracut\"><\/a><\/p>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0447\u0443\u0442\u044c-\u0447\u0443\u0442\u044c \u043f\u043e\u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043f\u0440\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0443 motion.<br \/>  \u0412 \u0441\u0432\u044f\u0437\u0438 \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c, \u043f\u043e-\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438, \u043e\u0431\u043e\u0439\u0442\u0438\u0441\u044c \u0447\u0438\u0441\u0442\u044b\u043c HTML5, \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043f\u0435\u0440\u0435\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c motion \u0432\u0440\u0443\u0447\u043d\u0443\u044e, \u0432\u043a\u043b\u044e\u0447\u0438\u0432 \u0435\u043c\u0443 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 \u0437\u0430\u043f\u0438\u0441\u0438 \u0444\u0430\u0439\u043b\u043e\u0432 \u0432 ogg. \u0411\u043b\u0430\u0433\u043e \u0430\u0432\u0442\u043e\u0440\u044b \u0434\u0430\u043d\u043d\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b\u0438 \u0435\u0435, \u0437\u0430 \u0447\u0442\u043e \u0438\u043c \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u0441\u043f\u0430\u0441\u0438\u0431\u043e. \u041f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441\u0431\u043e\u0440\u043a\u0438 \u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043e\u043f\u0438\u0441\u0430\u043d \u0445\u043e\u0440\u043e\u0448\u043e \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0435 \u0431\u0443\u0434\u0443 \u0435\u0433\u043e \u0437\u0434\u0435\u0441\u044c \u0440\u0430\u0441\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c, \u0442\u0435\u043c \u0431\u043e\u043b\u0435\u0435, \u0447\u0442\u043e \u043f\u043e\u0434 \u0440\u0430\u0437\u043d\u044b\u0435 \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432\u044b \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043b\u0438\u0447\u0430\u0442\u044c\u0441\u044f. \u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u0434\u043e\u043c\u0430\u0448\u043d\u044e\u044e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 <a href=\"http:\/\/www.lavrsen.dk\/foswiki\/bin\/view\/Motion\/MotionGuideInstallation\">www.lavrsen.dk\/foswiki\/bin\/view\/Motion\/MotionGuideInstallation<\/a>.<br \/>  \u0417\u0430\u043e\u0441\u0442\u0440\u044e \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0430.<br \/>  \u0422\u0430\u043a \u043a\u0430\u043a \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e motion \u0431\u044b\u043b \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u0438\u0437 \u043f\u0430\u043a\u0435\u0442\u043e\u0432, \u0442\u043e \u043f\u043e\u0441\u043b\u0435 \u043f\u0435\u0440\u0435\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043d\u0435 \u0441\u0442\u0430\u043b \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u0442\u044c \u043f\u0430\u043f\u043a\u0443 \u0441 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0435\u0439 \u0438\u0437 \/etc \u0432 \/usr\/local\/etc.<br \/>  \u0418 \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u043f\u0443\u043d\u043a\u0442, \u0441\u0430\u043c motion \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 runit, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0435 \u043e\u043d \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d \u0440\u0435\u0436\u0438\u043c \u0434\u0435\u043c\u043e\u043d\u0430.<br \/>  \u0420\u0430\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0441\u0438\u043b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f:<br \/>  1. \u041a\u043e\u043d\u0444\u0438\u0433\u0438 motion \u043b\u0435\u0436\u0430\u0442 \u0432 \/etc\/motion.<br \/>  2. \u0412\u0438\u0434\u0435\u043e \u043f\u0438\u0448\u0435\u0442\u0441\u044f \u043d\u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0436\u0435\u0441\u0442\u043a\u0438\u0439 \u0434\u0438\u0441\u043a, \u0441\u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \/video, \u0432 \u043f\u0430\u043f\u043a\u0438 \u0441 \u0438\u043c\u0435\u043d\u0430\u043c\u0438 \u043a\u0430\u043c\u0435\u0440.<br \/>  3. \u0412 \u0431\u0430\u0437\u0443 \u043e\u0442\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0437\u0430\u043f\u0438\u0441\u0438, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u044f, \u043f\u043e\u043b\u043d\u043e\u043c\u0443 \u043f\u0443\u0442\u0438 \u043a \u0444\u0430\u0439\u043b\u0443 \u0441\u043e\u0431\u044b\u0442\u0438\u044f, \u0442\u0438\u043f\u043e\u043c \u0444\u0430\u0439\u043b\u0430 (\u0432 \u043c\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u0438\u0434\u0435\u043e).<br \/>  \u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u044b<br \/>  <code>CREATE TABLE records (   id serial NOT NULL,   thread integer,   filename character varying(255),   frame integer,   file_type integer,   event_timestamp timestamp without time zone,   created_at timestamp without time zone NOT NULL,   updated_at timestamp without time zone NOT NULL,   CONSTRAINT records_pkey PRIMARY KEY (id ) ) WITH (   OIDS=FALSE ); ALTER TABLE records   OWNER TO motion;  -- Index: thread  -- DROP INDEX thread;  CREATE INDEX thread   ON records   USING btree   (thread );<\/code><br \/>  4. \u0414\u043b\u044f \u0436\u0438\u0432\u043e\u0433\u043e \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0430 (\u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438) \u0441 \u043a\u0430\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0442\u0435\u0441\u044f \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 motion.<\/p>\n<p>  \u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435:<br \/>  \/etc\/motion.conf<br \/>  ffmpeg_video_codec ogg<\/p>\n<p>  webcontrol_port 8080<br \/>  webcontrol_localhost off (\u0432 \u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 web-interface \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435)<br \/>  webcontrol_html_output on<br \/>  webcontrol_authentication login:pass<\/p>\n<p>  sql_query insert into records(thread, filename, frame, file_type, event_timestamp, created_at, updated_at) values(&#8216;%t&#8217;, &#8216;%f&#8217;, &#8216;%q&#8217;, &#8216;%n&#8217;, &#8216;%Y-%m-%d %T&#8217;, NOW(), NOW())<\/p>\n<p>  \u0418 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0434\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a \u0411\u0414.<\/p>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u043a\u0430\u043c\u0435\u0440\u044b<br \/>  thread \/etc\/motion\/thread1.conf <br \/>  thread \/etc\/motion\/thread2.conf<br \/>  \u2026<br \/>  thread \/etc\/motion\/threadN.conf,<br \/>  \u0433\u0434\u0435 N \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043d\u0430\u0448\u0438\u0445 \u043a\u0430\u043c\u0435\u0440.<\/p>\n<p>  \u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043f\u0443\u043d\u043a\u0442\u044b \u0432 threadX.conf, \u0433\u0434\u0435 X \u2014 \u043b\u044e\u0431\u043e\u0435 \u0447\u0438\u0441\u043b\u043e<br \/>  stream_port PortNumber \u2014 \u0434\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u0440\u0442 \u043d\u0430\u0434\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u0438\u0441\u0430\u0442\u044c \u0432 \u043f\u043e\u043b\u0435 \u00ab\u041f\u043e\u0440\u0442 \u043f\u043e\u0442\u043e\u043a\u043e\u0432\u043e\u0433\u043e \u0432\u0435\u0449\u0430\u043d\u0438\u044f\u00bb \u043f\u0440\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 \u043a\u0430\u043c\u0435\u0440 \u0432 web-interface.<br \/>  \u042d\u0442\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043f\u0440\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 motion. \u041a\u0430\u043a \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0441\u0430\u043c motion \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0441\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u043d\u0435 \u0431\u0443\u0434\u0443.<br \/>  \u041f\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 Rails \u0445\u043e\u0440\u043e\u0448\u043e \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043d\u043e \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 <a href=\"http:\/\/habrahabr.ru\/post\/140910\/\">habrahabr.ru\/post\/140910\/<\/a>. \u0422\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u0435\u0442 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0432 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 NodeJS \u2014 <a href=\"https:\/\/github.com\/joyent\/node\/wiki\/Installing-Node.js-via-package-manager\">github.com\/joyent\/node\/wiki\/Installing-Node.js-via-package-manager<\/a><\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043a \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430:<br \/>  1. \u041a\u043b\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 git \u0441\u0430\u0439\u0442.<br \/>  Bitbucket:<br \/>  git clone <a href=\"https:\/\/webdev4u\">webdev4u<\/a>@bitbucket.org\/webdev4u\/motion_web.git<br \/>  Github:<br \/>  git clone <a href=\"https:\/\/github.com\/webdev4u\/motion_web.git\">github.com\/webdev4u\/motion_web.git<\/a><br \/>  2. \u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u0442\u044c config\/settings.local.yml \u0432 config\/settings.yml \u0438 \u0432\u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0443\u0434\u0430 \u0430\u0434\u0440\u0435\u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0437\u0430\u043f\u0443\u0449\u0435\u043d motion.<br \/>  3. \u041f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u0442\u044c config\/database.yml.example \u0432 config\/database.yml \u0438 \u0432\u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0443\u0434\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0434\u043b\u044f \u0432\u0430\u0448\u0435\u0439 \u0431\u0430\u0437\u044b.<br \/>  4. \u0418\u0437\u043c\u0435\u043d\u0438\u0442\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 db\/seeds.rb \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f admin.<br \/>  5. rake db:migrate<br \/>  6. rake db:seed<br \/>  7. \u0414\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c rails s. \u0421\u0435\u0440\u0432\u0435\u0440 \u0431\u0443\u0434\u0435\u0442 \u0441\u043b\u0443\u0448\u0430\u0442\u044c \u043d\u0430 3000 \u043f\u043e\u0440\u0442\u0443. \u0415\u0441\u043b\u0438 \u0432\u0441\u0435 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e, \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c.<br \/>  8. \u0418 \u043d\u0430\u043f\u043e\u0441\u043b\u0435\u0434\u043e\u043a, \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0437\u0430\u0434\u0430\u043d\u0438\u0435 \u0434\u043b\u044f \u043a\u0440\u043e\u043d\u0430 \u043f\u043e \u0447\u0438\u0441\u0442\u043a\u0435 \u0431\u0430\u0437\u044b. \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0437\u0430\u043f\u0438\u0441\u0438 \u0437\u0430 21 \u0434\u0435\u043d\u044c, \u043d\u043e \u043c\u043e\u0436\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0432 \u0444\u0430\u0439\u043b\u0435 app\/models\/record.rb 12 \u0441\u0442\u0440\u043e\u043a\u0430, \u043d\u043e \u043b\u0443\u0447\u0448\u0435 \u0432 lib\/tasks\/crontask.rake \u0441\u0442\u0440\u043e\u043a\u0443<br \/>  Record.clean_old_records<br \/>  \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u043d\u0430<br \/>  Record.clean_old_records \u041d\u0443\u0436\u043d\u043e\u0435_\u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e_\u0434\u043d\u0435\u0439.<br \/>  \u041f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u043f\u0440\u043e\u0433\u043d\u0430\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0443<br \/>  whenever &#8212;update-crontab \u0438\u0437 \u043f\u043e\u0434 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u043e\u0442 \u0438\u043c\u0435\u043d\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441\u0430\u0439\u0442.<\/p>\n<p>  \u0421\u043a\u0440\u0438\u043d\u0448\u043e\u0442 \u0433\u043b\u0430\u0432\u043d\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b:<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/a20\/0a9\/c60\/a200a9c60cb3ee93017366d06257da72.png\"\/><br \/>  \u0421\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u0432\u0445\u043e\u0434\u0430:<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/2ea\/438\/caf\/2ea438caf28176264bd3c099900a896e.png\"\/><br \/>  \u0416\u0438\u0432\u043e\u0439 \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440:<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/f88\/0ad\/017\/f880ad017651eebd02d7f871eb27a422.png\"\/><br \/>  \u0421\u043f\u0438\u0441\u043e\u043a \u043a\u0430\u043c\u0435\u0440:<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/707\/168\/749\/70716874900c9833d215e25b0ed13463.png\"\/><br \/>  \u041f\u0440\u043e\u0441\u043c\u043e\u0442\u0440 \u0430\u0440\u0445\u0438\u0432\u0430:<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/4e7\/90c\/02f\/4e790c02fa09c8bfc5be1f6561c1fce6.png\"\/><br \/>  \u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f:<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/84f\/f7b\/7f8\/84ff7b7f81a930d61d8c114622294906.png\"\/><br \/>  \u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043a\u0430\u043c\u0435\u0440\u044b:<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/e3f\/2da\/70f\/e3f2da70f63663b9f86abe64abf88b33.png\"\/>    \t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/190728\/\"> http:\/\/habrahabr.ru\/post\/190728\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t\u041f\u043e\u0441\u043b\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0432\u0438\u0434\u0435\u043e\u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043f\u043e\u0434 debian, \u0431\u044b\u043b\u043e \u043f\u0440\u0438\u043d\u044f\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0432\u0438\u0434\u0435\u043e\u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u044f.<br \/>  Motion \u0431\u044b\u043b\u043e \u0440\u0435\u0448\u0435\u043d\u043e \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c, \u043d\u043e \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0432 \u0431\u043e\u043b\u0435\u0435 \u0447\u0435\u043b\u043e\u0432\u0435\u0447\u0435\u0441\u043a\u043e\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0435 \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0430 \u0430\u0440\u0445\u0438\u0432\u043d\u044b\u0445 \u0437\u0430\u043f\u0438\u0441\u0435\u0439.<br \/>  \u041e\u0447\u0435\u0440\u0435\u0434\u043d\u044b\u0435 \u043f\u043e\u0438\u0441\u043a\u0438 \u0432 \u0418\u043d\u0442\u0435\u0440\u043d\u0435\u0442 \u0442\u0430\u043a \u0438 \u043d\u0435 \u0434\u0430\u043b\u0438 \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u043f\u0440\u0438\u0435\u043c\u043b\u0435\u043c\u044b\u0445 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432, \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0447\u0435\u0433\u043e \u0431\u044b\u043b\u043e \u043f\u0440\u0438\u043d\u044f\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0430.<br \/>  \u041f\u043e\u0441\u043b\u0435 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043a\u043e\u043b\u0435\u0431\u0430\u043d\u0438\u0439, \u0432\u044b\u0431\u043e\u0440 \u043f\u0430\u043b \u043d\u0430 Rails. \u041d\u0438\u043a\u0430\u043a\u043e\u0439 \u0440\u0435\u043b\u0438\u0433\u0438\u0438, \u043f\u0440\u043e\u0441\u0442\u043e \u0437\u0430\u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u043f\u043e\u043b\u0443\u0447\u0448\u0435 \u0438\u0437\u0443\u0447\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u0438 \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u044f\u0437\u044b\u043a \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0421\u0423\u0411\u0414 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f PostgreSQL.<br \/>  \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-190728","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/190728","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=190728"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/190728\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=190728"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=190728"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=190728"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}