{"id":232087,"date":"2014-08-04T13:01:03","date_gmt":"2014-08-04T09:01:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=232087"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=232087","title":{"rendered":"<span class=\"post_title\">\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f samba-\u0440\u0430\u0437\u0434\u0435\u043b\u043e\u0432 \u0432 Mac OS<\/span>"},"content":{"rendered":"<div class=\"content html_format\"> \t\t\t\u0422\u0440\u0435\u0442\u044c\u0435\u0433\u043e \u0434\u043d\u044f \u043f\u043e\u0434\u043d\u044f\u043b \u0441\u0435\u0440\u0432\u0435\u0440 \u0434\u043b\u044f \u0444\u0430\u0439\u043b\u043e\u043f\u043e\u043c\u043e\u0439\u043a\u0438, \u0431\u044d\u043a\u0430\u043f\u043e\u0432, \u0442\u043e\u0440\u0440\u0435\u043d\u0442\u043e\u0432 \u0438 \u043f\u0440\u043e\u0447\u0438\u0445 \u0434\u043e\u043c\u0430\u0448\u043d\u0438\u0445 \u043d\u0443\u0436\u0434. \u0422\u0430\u043c \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u043b\u0430\u0441\u044c samba \u0441 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e\u043c \u0448\u0430\u0440, \u0432 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438 \u0441 \u043b\u0438\u0447\u043d\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0438 \u043c\u0435\u0441\u0442\u043e\u043c \u043f\u043e\u0434 \u0431\u044d\u043a\u0430\u043f\u044b \u043d\u043e\u0443\u0442\u0431\u0443\u043a\u0430 \u0447\u0435\u0440\u0435\u0437 TimeMachime. \u0421\u0440\u0430\u0437\u0443 \u0436\u0435 \u043d\u0435 \u043f\u043e\u043d\u0440\u0430\u0432\u0438\u043b\u043e\u0441\u044c \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e\u0435 \u0440\u0443\u0447\u043d\u043e\u0435 \u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0448\u0430\u0440\u044b \u0438 \u043e\u0431\u0440\u0430\u0437\u0430 \u0434\u043b\u044f \u0431\u044d\u043a\u0430\u043f\u0430. \u041d\u0438\u0436\u0435 \u0445\u043e\u0447\u0443 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441 \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u043e\u043c \u0441\u043a\u0440\u0438\u043f\u0442\u0430\u043c\u0438 \u043f\u043e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h4>\u041f\u0440\u0438\u0447\u0438\u043d\u044b \u043d\u0435\u0443\u0434\u043e\u0431\u0441\u0442\u0432<\/h4>\n<p>  \u041a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u0434\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a \u0441\u0430\u043c\u0431\u0435 \u043d\u0430\u0434\u043e \u0438\u0437\u0440\u044f\u0434\u043d\u043e \u043f\u043e\u0442\u044b\u043a\u0430\u0442\u044c \u043c\u044b\u0448\u043a\u043e\u0439: Finder -&gt; \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a \u0441\u0435\u0440\u0432\u0435\u0440\u0443 -&gt; \u0432\u0432\u043e\u0434 \u0438\u043c\u0435\u043d\u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 (-&gt; \u043f\u0435\u0440\u0432\u044b\u0439 \u0440\u0430\u0437 \u0435\u0449\u0451 \u0438 \u043f\u0430\u0440\u043e\u043b\u044c \u0441\u043f\u0440\u043e\u0441\u044f\u0442) -&gt; \u0432\u044b\u0431\u043e\u0440 \u043f\u0430\u043f\u043e\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c -&gt; Ok. \u041f\u043e\u0442\u043e\u043c, \u0435\u0441\u043b\u0438 \u0437\u0430\u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0434\u0435\u043b\u0430\u0442\u044c \u0431\u044d\u043a\u0430\u043f \u0432 \u043f\u0440\u0438\u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u043f\u043e \u0441\u0430\u043c\u0431\u0435 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e, \u043f\u0440\u0438\u0439\u0434\u0451\u0442\u0441\u044f \u0435\u0449\u0451 \u0438 \u043e\u0431\u0440\u0430\u0437 .sparsebundle \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c, \u0438 \u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0435\u0449\u0451 \u0438 \u0435\u0433\u043e. \u0412\u0441\u0451 \u044d\u0442\u043e, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0438 \u043d\u0435 \u0441\u0438\u043b\u044c\u043d\u043e \u043d\u0430\u043f\u0440\u044f\u0433\u0430\u0435\u0442, \u0435\u0441\u043b\u0438 \u0434\u0435\u043b\u0430\u0442\u044c \u0440\u0430\u0437 \u0432 \u043f\u0430\u0440\u0443 \u043d\u0435\u0434\u0435\u043b\u044c \u043d\u0430 \u0441\u0442\u0430\u0446\u0438\u043e\u043d\u0430\u0440\u043d\u043e\u043c \u041f\u041a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u043e\u0434\u043d\u043e\u0439 \u0438 \u0442\u043e\u0439 \u0436\u0435 \u0441\u0435\u0442\u0438 \u0438 \u043d\u0435 \u0432\u044b\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0442\u0430\u043a \u0436\u0435, \u043a\u0430\u043a \u0438 \u0441\u0435\u0440\u0432\u0435\u0440. \u041d\u043e \u043a\u043e\u0433\u0434\u0430 \u044d\u0442\u043e \u043d\u0430\u0434\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u043f\u043e\u0441\u043b\u0435 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f\/\u043f\u0440\u043e\u0431\u0443\u0436\u0434\u0435\u043d\u0438\u044f \u043d\u043e\u0443\u0442\u0431\u0443\u043a\u0430 \u2014 \u044d\u0442\u043e \u043d\u0438 \u0432 \u043a\u0430\u043a\u0438\u0435 \u0432\u043e\u0440\u043e\u0442\u0430 \u043d\u0435 \u043b\u0435\u0437\u0435\u0442. \u041f\u043b\u044e\u0441 \u043a \u044d\u0442\u043e\u043c\u0443 \u0432\u044b\u044f\u0441\u043d\u0438\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u043d\u0435 \u043e\u0442\u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u0434\u0435\u043b\u044b \u0438 \u0441\u043c\u0435\u043d\u0438\u0442\u044c \u0441\u0435\u0442\u044c (\u0441\u043a\u0430\u0436\u0435\u043c \u043f\u0440\u0438\u0439\u0442\u0438 \u043a \u0441\u043e\u0441\u0435\u0434\u0443 \u0432 \u0433\u043e\u0441\u0442\u0438), \u0442\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0438\u0437\u0440\u044f\u0434\u043d\u043e \u0432\u0438\u0441\u043d\u0435\u0442 \u043f\u043e\u0441\u043b\u0435 \u0432\u044b\u0445\u043e\u0434\u0430 \u0438\u0437 \u0441\u043d\u0430, \u0438\u0431\u043e \u043d\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u0442 \u0441\u0435\u0440\u0432\u0435\u0440 \u0441 \u0448\u0430\u0440\u0430\u043c\u0438, \u0430, \u0432 \u0440\u0435\u0434\u043a\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445, \u0435\u0449\u0451 \u0438 \u0432 kernel panic \u0441\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f. \u0412\u0441\u0451 \u044d\u0442\u043e \u0441\u0438\u043b\u044c\u043d\u043e \u043e\u043c\u0440\u0430\u0447\u0438\u043b\u043e \u0440\u0430\u0434\u043e\u0441\u0442\u044c \u043f\u043e\u0434\u043d\u044f\u0442\u0438\u044f \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0438 \u043c\u0435\u0447\u0442\u044b \u043e \u0442\u043e\u043c \u0447\u0442\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u044f \u0434\u0430\u0436\u0435 \u0432\u0441\u043f\u043e\u043c\u0438\u043d\u0430\u0442\u044c \u043d\u0435 \u0431\u0443\u0434\u0443 \u043e \u0431\u044d\u043a\u0430\u043f\u0430\u0445, \u043f\u043e\u043a\u0430 \u043e\u043d\u0438 \u043c\u043d\u0435 \u043d\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u044f\u0442\u0441\u044f (\u0442\u044c\u0444\u0443 \u0442\u044c\u0444\u0443 \u0442\u044c\u0444\u0443). \u0411\u044b\u043b\u043e \u0440\u0435\u0448\u0435\u043d\u043e, \u0447\u0442\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043d\u0443\u0436\u043d\u043e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c.<\/p>\n<h4>\u041d\u0430 \u043f\u0435\u0440\u0432\u044b\u0445 \u043f\u043e\u0440\u0430\u0445<\/h4>\n<p>  \u0412 \u043f\u043e\u043f\u044b\u0445\u0430\u0445 \u0431\u044b\u043b\u0438 \u043d\u0430\u0433\u0443\u0433\u043b\u0435\u043d\u044b \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0430\u043c\u0431\u044b \u0438 \u0442\u0443\u0442 \u0436\u0435 \u0440\u043e\u0434\u0438\u043b\u0441\u044f \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u0438\u0437 \u043f\u0430\u0440\u043e\u0447\u043a\u0438 \u0438\u0434\u0435\u043d\u0442\u0438\u0447\u043d\u044b\u0445 \u043a\u043e\u043c\u0430\u043d\u0434 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0432\u0438\u0434\u0430:  <\/p>\n<pre><code class=\"bash\">mkdir -p \/mount\/point <\/code><\/pre>\n<p>  \u0422\u0430\u043a \u0436\u0435 \u0431\u044b\u043b\u043e \u043d\u0430\u0439\u0434\u0435\u043d\u043e \u043a\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0430\u0442\u0442\u0430\u0447 \u043e\u0431\u0440\u0430\u0437\u0430 \u0434\u043b\u044f TimeMachine:  <\/p>\n<pre><code class=\"bash\">hdiutil attach -mountpoint \/mount\/point \/path\/to\/image.sparsebundle\/ <\/code><\/pre>\n<p> hdutil \u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u0431\u043e\u043b\u0435\u0435 \u0441\u043c\u044b\u0448\u043b\u0451\u043d\u044b\u043c \u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u0430\u043f\u043e\u043a \u043d\u0435 \u043f\u043e\u0442\u0440\u0435\u043b\u043e\u0432\u0430\u043b.<br \/>  \u041f\u0435\u0440\u0432\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0431\u044b\u043b\u0430 \u0433\u043e\u0442\u043e\u0432\u0430.<\/p>\n<h4>\u0411\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c<\/h4>\n<p>  \u041e\u0447\u0435\u043d\u044c \u043d\u0430\u043f\u0440\u044f\u0433\u0430\u043b\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435 \u043f\u0430\u0440\u043e\u043b\u044f \u0432 \u044f\u0432\u043d\u043e\u043c \u0432\u0438\u0434\u0435 \u043f\u0440\u0438 \u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438. \u041f\u043e\u0447\u0438\u0442\u0430\u0432 \u043c\u0430\u043d \u0434\u043b\u044f <i>mount_smbfs<\/i> \u0443\u0437\u043d\u0430\u043b \u043f\u0440\u043e <i>nsmb.conf<\/i>. \u041d\u043e \u0438\u0434\u0435\u044f \u0442\u0430\u043a \u0436\u0435 \u043d\u0435 \u0448\u0438\u0431\u043a\u043e \u043f\u043e\u043d\u0440\u0430\u0432\u0438\u043b\u0430\u0441\u044c, \u0442\u0430\u043a \u043a\u0430\u043a \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u043f\u0430\u0440\u043e\u043b\u044c \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0433\u0434\u0435-\u0442\u043e \u0432 \u0444\u0430\u0439\u043b\u0435 \u0432 \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u043c \u0432\u0438\u0434\u0435. \u0422\u0443\u0442 \u0436\u0435 \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u043b, \u0447\u0442\u043e \u0447\u0435\u0440\u0435\u0437 GUI \u043f\u0430\u0440\u043e\u043b\u044c \u0441\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u044e\u0442 \u0435\u0434\u0438\u043d\u043e\u0436\u0434\u044b, \u0430 \u0434\u0430\u043b\u0435\u0435 \u0432\u044b\u0442\u0430\u0441\u043a\u0438\u0432\u0430\u044e\u0442 \u0438\u0437 keychain. \u0417\u0430\u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0451. \u041e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438, \u043a\u0430\u043a \u0435\u0441\u043b\u0438 \u0431\u044b \u0432\u0437\u044f\u043b <i>nsmb.conf<\/i> \u0438 \u0434\u043e\u043f\u0438\u0441\u0430\u043b \u043a\u043b\u044e\u0447\u0438\u043a -N \u043a <i>mount_smbfs<\/i>, \u043f\u0430\u0440\u043e\u043b\u044c \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 (\u0447\u0443\u0434\u0430 \u043d\u0435 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u043e). \u041f\u0440\u0438\u0439\u0434\u0451\u0441\u044f \u0435\u0433\u043e \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 <i>security<\/i> \u0438 \u0437\u0430\u0442\u0435\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0432 \u043d\u0443\u0436\u043d\u043e\u0435 \u043c\u0435\u0441\u0442\u043e. \u0414\u043b\u044f \u0441\u0438\u0445 \u0446\u0435\u043b\u0435\u0439 \u0431\u044b\u043b\u0430 \u043d\u0430\u0433\u0443\u0433\u043b\u0435\u043d\u0430 \u0438 \u043f\u0435\u0440\u0435\u0434\u0435\u043b\u0430\u043d\u0430 \u043f\u043e\u0434 \u0441\u0432\u043e\u0438 \u043d\u0443\u0436\u0434\u044b \u0444\u0443\u043d\u043a\u0446\u0438\u044f:  <\/p>\n<pre><code class=\"bash\">get_inet_pwd () {   security 2&gt;&1 &gt;\/dev\/null find-internet-password -gl $1 \\   |ruby -e 'print $1 if STDIN.gets =~ \/^password: &quot;(.*)&quot;$\/' } <\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u044f\u0432\u043d\u043e\u0435 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435 \u043f\u0430\u0440\u043e\u043b\u044f \u0431\u044b\u043b\u043e \u0437\u0430\u043c\u0435\u043d\u0435\u043d\u043e \u043d\u0430:  <\/p>\n<pre><code class=\"bash\">mount -t smbfs \/\/user:&quot;$(get_inet_pwd server-pc)&quot;@server-pc\/shara_name \/mount\/point <\/code><\/pre>\n<p>  \u041f\u0430\u0440\u0430\u043d\u043e\u0439\u044f \u043e\u0442\u0441\u0442\u0443\u043f\u0438\u043b\u0430, \u043d\u043e \u043b\u044e\u0431\u043e\u0437\u043d\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0438 \u043f\u0435\u0440\u0444\u0435\u043a\u0446\u0438\u043e\u043d\u0438\u0437\u043c \u043e\u0441\u0442\u0430\u043b\u0438\u0441\u044c, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u0435\u043b\u043e \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u043b\u043e\u0441\u044c.<\/p>\n<h4>\u0423\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f \u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435<\/h4>\n<p>  \u0417\u0430\u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043e\u0434\u0438\u043d \u0441\u043a\u0440\u0438\u043f\u0442 \u0434\u043b\u044f \u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0432\u0441\u0435\u0433\u043e \u0438 \u0441\u0440\u0430\u0437\u0443, \u0434\u0430 \u0442\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u0442\u044c, \u0447\u0442\u043e\u0431\u044b \u043e\u043d \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u043c\u044b\u0439 \u0431\u044b\u043b\u043e \u0438 \u043f\u043e\u0432\u0442\u043e\u0440\u044f\u0442\u044c \u043a\u043e\u0434 \u043c\u043d\u043e\u0433\u043e \u0440\u0430\u0437 \u043d\u0435 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c, \u043f\u043b\u044e\u0441 \u0447\u0442\u043e\u0431\u044b \u0441\u043c\u043e\u0442\u0440\u0435\u043b \u0447\u0442\u043e \u0443\u0436\u0435 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u043f\u0440\u0438\u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u0438 \u0432\u0442\u043e\u0440\u043e\u0439 \u0440\u0430\u0437 \u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0435 \u043f\u044b\u0442\u0430\u043b\u0441\u044f. \u0421\u043a\u0430\u0437\u0430\u043d\u043e \u2014 \u0441\u0434\u0435\u043b\u0430\u043d\u043e. \u041e\u043f\u0438\u0448\u0443 \u0432\u0441\u0451 \u043f\u043e-\u043f\u043e\u0440\u044f\u0434\u043a\u0443.<\/p>\n<p>  \u0414\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043e\u0441\u0442\u0438, \u043d\u0430 \u043f\u0435\u0440\u0432\u043e\u043c \u044d\u0442\u0430\u043f\u0435, \u0431\u044b\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d \u0441\u0430\u043c\u044b\u0439 \u00ab\u0442\u043e\u043f\u043e\u0440\u043d\u044b\u0439\u00bb \u043c\u0435\u0442\u043e\u0434  <\/p>\n<pre><code class=\"bash\">if [ ! -d \/mount\/point\/ ]; then   mkdir -p \/mount\/point   mount \u2026 fi <\/code><\/pre>\n<p>  \u041d\u043e \u0441\u0440\u0430\u0437\u0443 \u0436\u0435 \u0441\u0442\u0430\u043b\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u0447\u0442\u043e \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u0438 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c, \u043d\u043e \u043d\u0435 \u044f\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0442\u043e\u0447\u043a\u043e\u0439 \u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u043b\u044f \u0447\u0435\u0433\u043e-\u043b\u0438\u0431\u043e. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u0434\u0435\u043b\u0430\u043b \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438:  <\/p>\n<pre><code class=\"bash\">is_volume_mounted() {   volume_name=$1   mount | awk -v volume_name=$volume_name '$3 == volume_name {print $3}' } <\/code><\/pre>\n<p> \u041c\u0435\u0442\u043e\u0434 \u0442\u043e\u0436\u0435 \u043d\u0435 \u0438\u0434\u0435\u0430\u043b\u0435\u043d, \u043d\u043e \u0443\u0436\u0435 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043b\u0443\u0447\u0448\u0435, \u043d\u0435\u0436\u0435\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0430\u043b\u0438\u0447\u0438\u044f \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438.<\/p>\n<p>  \u0422\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u0431\u044b\u043b\u043e \u0441\u0434\u0435\u043b\u0430\u043d\u043e \u0438 \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043e\u0431\u0440\u0430\u0437\u0430 \u0431\u044d\u043a\u0430\u043f\u0430:  <\/p>\n<pre><code class=\"bash\">is_image_attached() {   img_path=$1   df -Hl | awk -v img_path=$img_path '$9 == img_path {print $9}' } <\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0440\u0430\u0437\u0434\u0443\u043c\u0438\u0439 \u0438 \u0447\u0442\u0435\u043d\u0438\u044f \u0444\u043e\u0440\u0443\u043c\u043e\u0432 \u043c\u0435\u0442\u043e\u0434 \u0440\u0430\u0437\u0434\u0443\u043b\u0441\u044f \u0438 \u0441\u0442\u0430\u043b \u0441\u0440\u0430\u0437\u0443 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u043f\u0440\u0438\u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d \u043b\u0438 \u043e\u0431\u0440\u0430\u0437, \u0438, \u0435\u0441\u043b\u0438 \u043d\u0435\u0442, \u0442\u043e \u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e.  <\/p>\n<pre><code class=\"bash\">try_attach_fs_image() {   img_path=$1   mnt_pnt_path=$2   # check existance of image file   if [ -d $img_path ]; then     # check if image alredy attached in system     if [[ $(df -Hl | awk -v img_path=$img_path '$9 == img_path {print $9}') != &quot;&quot; ]]; then       echo image $img_path alredy attached     else       hdiutil attach -mountpoint $mnt_pnt_path $img_path     fi   fi } <\/code><\/pre>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u043d\u0443\u0436\u043d\u0430 \u0431\u044b\u043b\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043e\u043a \u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u043e \u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e \u043b\u044e\u0431\u043e\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0448\u0430\u0440 \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u0430. \u0412\u043e\u0442 \u043a\u0430\u043a\u043e\u0439 \u043e\u043d\u0430 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0430\u0441\u044c:  <\/p>\n<pre><code class=\"bash\">try_mount_server_samba() {   smb_vol_name=$1   mnt_pnt_path=$2   # check if samba share exist in network   if [[ $( is_samba_exist $smb_vol_name ) != &quot;&quot; ]]; then     # check if samba alredy mounted     if [[ $( is_volume_mounted $mnt_pnt_path ) != &quot;&quot; ]]; then       # show message about that       echo volume $mnt_pnt_path alredy mounted     else       # check if moint point directory not exist       if [ ! -d $mnt_pnt_path ]; then         mkdir -p $mnt_pnt_path       fi       # otherwise - mount volume       mount -t smbfs \/\/user:&quot;$(get_inet_pwd server-pc)&quot;@server-pc\/$smb_vol_name $mnt_pnt_path     fi   fi } <\/code><\/pre>\n<p>  \u0412\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044c \u0437\u0430\u043c\u0435\u0442\u0438\u0442, \u0447\u0442\u043e \u0432\u043e-\u043f\u0435\u0440\u0432\u044b\u0445: \u043c\u043e\u0436\u043d\u043e \u0438 \u0438\u043c\u044f \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u0445 \u043a \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0430 \u043d\u0435 \u0445\u0430\u0440\u0434\u043a\u043e\u0434\u0438\u0442\u044c \u0435\u0433\u043e, \u0430 \u0432\u043e-\u0432\u0442\u043e\u0440\u044b\u0445: \u0432 \u0441\u043a\u0440\u0438\u043f\u0442\u0435 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u0442\u0441\u044f \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f <i>is_samba_exist<\/i>.<\/p>\n<p>  \u041e\u0442\u0432\u0435\u0447\u0430\u044e \u043f\u043e-\u043f\u043e\u0440\u044f\u0434\u043a\u0443: 3-\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0434\u043b\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0431\u044b\u043b\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u043b\u0435\u043d\u044c, \u0438\u0431\u043e \u043f\u043e\u043a\u0430 \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0440\u0430 \u0441 \u0441\u0430\u043c\u0431\u043e\u0439 \u043d\u0435 \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u0435\u0442\u0441\u044f; \u0444\u0443\u043d\u043a\u0446\u0438\u044f <i>is_samba_exist<\/i> \u0438\u043c\u0435\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0432\u0438\u0434:  <\/p>\n<pre><code class=\"bash\">is_samba_exist() {   smb_vol_name=$1   smbutil view \/\/user:&quot;$(get_inet_pwd server-pc)&quot;@server-pc\/ | awk -v smb_vol_name=$smb_vol_name '$1 == smb_vol_name {print $1}' } <\/code><\/pre>\n<p> \u041d\u0435\u0441\u043b\u043e\u0436\u043d\u043e \u0434\u043e\u0433\u0430\u0434\u0430\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0448\u0430\u0440\u044b \u0441 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u043c \u0438\u043c\u0435\u043d\u0435\u043c \u0432 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0441\u0435\u0442\u0438.<\/p>\n<p>  \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0441\u0442\u0430\u043b\u0430 \u043f\u0440\u043e\u0441\u0442\u043e\u0439, \u043f\u043e\u043d\u044f\u0442\u043d\u043e\u0439 \u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u043c\u043e\u0439:  <\/p>\n<pre><code class=\"bash\">try_mount_server_samba &quot;shara_name&quot; &quot;\/mount\/point&quot; try_attach_fs_image &quot;\/path\/to\/image.sparsebundle&quot; &quot;\/mount\/point&quot; <\/code><\/pre>\n<p>  \u041d\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u043a, \u043f\u043e \u043e\u0431\u0440\u0430\u0437\u0443 \u0438 \u043f\u043e\u0434\u043e\u0431\u0438\u044e \u0432\u044b\u0448\u0435\u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0433\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u0430, \u0431\u044b\u043b \u0441\u043e\u0437\u0434\u0430\u043d \u0435\u0449\u0451 \u043e\u0434\u0438\u043d, \u043d\u043e \u0443\u0436\u0435 \u0434\u043b\u044f \u043e\u0442\u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0440\u0430\u0437\u0443 \u0432\u0441\u0435\u0433\u043e:  <\/p>\n<pre><code class=\"bash\">#!\/bin\/sh  # unmount volume if it mounted # syntax: umount_volume &quot;\/path\/to\/volume&quot; umount_volume() {   vol_path=$1   if [[ $(mount | awk -v vol_path=$vol_path '$3 == vol_path {print $3}') != &quot;&quot; ]]; then     umount $vol_path     echo $vol_path is unmounted   fi }  # detach filesystem image if it attached # syntax: detach_fs_image &quot;\/path\/to\/fs\/image&quot; detach_fs_image() {   img_path=$1   if [[ $(df -Hl | awk -v img_path=$img_path '$9 == img_path {print $9}') != &quot;&quot; ]]; then     hdiutil detach $img_path     echo $img_path is detched   fi }  # main part  # umnount data volume umount_volume &quot;\/data\/mount\/point&quot;  # firstly detach image from backup volume detach_fs_image &quot;\/backup\/image\/mount\/point&quot; # secondary unmount backup volume umount_volume &quot;\/backup\/volume\/mount\/point&quot; <\/code><\/pre>\n<p>  \u0412\u043e\u0442 \u0438 \u0432\u0441\u0451. \u0414\u0430\u043b\u044c\u0448\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0431\u044b\u043b\u0438 \u0443\u043d\u0435\u0441\u0435\u043d\u044b \u043a \u0441\u0432\u043e\u0438\u043c \u0441\u043e\u0431\u0440\u0430\u0442\u044c\u044f\u043c \u0432 <i>~\/.script<\/i>. \u041f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0435 \u0430\u043b\u0438\u0430\u0441\u044b \u0432 <i>.bash_profile<\/i> \u0438 \u0441\u0442\u0430\u043b\u0438 \u043f\u043e\u043c\u043e\u0433\u0430\u0442\u044c \u043c\u043d\u0435 \u0441 \u0441\u0430\u043c\u0431\u043e\u0439. <\/p>\n<h4>\u041f\u0435\u0440\u0441\u043f\u0435\u043a\u0442\u0438\u0432\u044b<\/h4>\n<p>  \u0412 \u0431\u0443\u0434\u0443\u0449\u0435\u043c, \u043a\u043e\u0433\u0434\u0430 \u0434\u043e\u0439\u0434\u0443\u0442 \u0440\u0443\u043a\u0438, \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u043f\u043e\u0434\u0440\u0443\u0436\u0438\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0441\u043e <i>SleepWatcher<\/i>, \u0434\u0430\u0431\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b\u0438\u0441\u044c \u043e\u043d\u0438 \u043f\u043e\u0441\u043b\u0435 \u0432\u044b\u0445\u043e\u0434\u0430 \u0438\u0437 \u0441\u043d\u0430 \u0438 \u043f\u0435\u0440\u0435\u0434 \u0443\u0445\u043e\u0434\u043e\u043c \u0432 \u043d\u0435\u0433\u043e \u0436\u0435. \u0422\u043e \u0435\u0441\u0442\u044c, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043d\u0430\u0434\u043e \u0431\u044b\u043b\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0440\u0443\u043a\u0430\u043c\u0438 \u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u0441\u0442\u0430\u043b\u0430 \u043f\u043e\u043b\u043d\u043e\u0439. \t\t\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\/232087\/\"> http:\/\/habrahabr.ru\/post\/232087\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\"> \t\t\t\u0422\u0440\u0435\u0442\u044c\u0435\u0433\u043e \u0434\u043d\u044f \u043f\u043e\u0434\u043d\u044f\u043b \u0441\u0435\u0440\u0432\u0435\u0440 \u0434\u043b\u044f \u0444\u0430\u0439\u043b\u043e\u043f\u043e\u043c\u043e\u0439\u043a\u0438, \u0431\u044d\u043a\u0430\u043f\u043e\u0432, \u0442\u043e\u0440\u0440\u0435\u043d\u0442\u043e\u0432 \u0438 \u043f\u0440\u043e\u0447\u0438\u0445 \u0434\u043e\u043c\u0430\u0448\u043d\u0438\u0445 \u043d\u0443\u0436\u0434. \u0422\u0430\u043c \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u043b\u0430\u0441\u044c samba \u0441 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e\u043c \u0448\u0430\u0440, \u0432 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438 \u0441 \u043b\u0438\u0447\u043d\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0438 \u043c\u0435\u0441\u0442\u043e\u043c \u043f\u043e\u0434 \u0431\u044d\u043a\u0430\u043f\u044b \u043d\u043e\u0443\u0442\u0431\u0443\u043a\u0430 \u0447\u0435\u0440\u0435\u0437 TimeMachime. \u0421\u0440\u0430\u0437\u0443 \u0436\u0435 \u043d\u0435 \u043f\u043e\u043d\u0440\u0430\u0432\u0438\u043b\u043e\u0441\u044c \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e\u0435 \u0440\u0443\u0447\u043d\u043e\u0435 \u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0448\u0430\u0440\u044b \u0438 \u043e\u0431\u0440\u0430\u0437\u0430 \u0434\u043b\u044f \u0431\u044d\u043a\u0430\u043f\u0430. \u041d\u0438\u0436\u0435 \u0445\u043e\u0447\u0443 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441 \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u043e\u043c \u0441\u043a\u0440\u0438\u043f\u0442\u0430\u043c\u0438 \u043f\u043e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430.  <\/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-232087","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/232087","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=232087"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/232087\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=232087"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=232087"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=232087"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}