{"id":430,"date":"2009-06-01T15:57:16","date_gmt":"2009-06-01T11:57:16","guid":{"rendered":"http:\/\/www.unixpin.com\/wordpress\/?p=430"},"modified":"2010-06-15T16:00:23","modified_gmt":"2010-06-15T12:00:23","slug":"backup_using_ufsdump","status":"publish","type":"post","link":"https:\/\/www.unixpin.com\/?p=430","title":{"rendered":"\u0420\u0435\u0437\u0435\u0440\u0432\u043d\u0430\u044f \u043a\u043e\u043f\u0438\u044f \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0441 \u043f\u043e\u043c\u043e\u0448\u044c\u044e ufsdump"},"content":{"rendered":"<p>\u0421\u0442\u0430\u0440\u044b\u0439 \u0434\u0435\u0434\u043e\u0432\u0441\u043a\u0438\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u043e \u0437\u0430\u0431\u0430\u043a\u0430\u043f\u0438\u0442\u044c \u0444\u0430\u0439\u043b\u043e\u0432\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 ufs.<\/p>\n<p>\u0421\u043f\u043e\u0441\u043e\u0431 \u043f\u043e\u0434\u043d\u044f\u0442\u044b\u0439 \u0438\u0437 \u043c\u0430\u043d\u043e\u0432 ;) \u0420\u0435\u0448\u0438\u043b \u0437\u0430\u043f\u043e\u0441\u0442\u0438\u0442\u044c, \u0447\u0442\u043e\u0431\u044b \u043b\u0435\u0433\u0447\u0435 \u0431\u044b\u043b\u043e \u0438\u0441\u043a\u0430\u0442\u044c.<\/p>\n<p>\u041d\u043e \u0438 \u0432\u0434\u0440\u0443\u0433 \u043a\u043e\u043c\u0443 \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u0441\u044f? ;)<\/p>\n<p><!--more--><\/p>\n<p>\u0421\u043c\u044b\u0441\u043b \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u0441\u043d\u0430\u043f\u0448\u043e\u0442 \u0438 \u043d\u0430 \u043d\u0435\u0433\u043e \u043d\u0430\u0442\u0440\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0441\u044f ufsdump<\/p>\n<p>#!\/usr\/bin\/sh<\/p>\n<p>#written by jsn<br \/>\n#Copyright unixpin.com<\/p>\n<p>#uncomment following 3 lines to use script with cli attributes<br \/>\n#ARCHIVE=$1<br \/>\n#SNAPSHOT=$2<br \/>\n#TOBACKUP=$3<\/p>\n<p># and comment these 3 ;)<br \/>\nARCHIVE=\/fsrv\/bakups\/dump`date &#8216;+%Y%m%d%H%M&#8217;`<br \/>\nSNAPSHOT=\/tmp\/snap<br \/>\nTOBACKUP=\/export\/data<\/p>\n<p>LOG=\/var\/tmp\/dump_create.log<\/p>\n<p>#error raising routine<br \/>\nraise_err()<br \/>\n{<br \/>\necho &#171;Error: $1&#187; &gt;&gt;$LOG<br \/>\necho &#171;Unable to continue&#187; &gt;&gt;$LOG<br \/>\nexit 1<br \/>\n}<\/p>\n<p>echo &#171;Begin dumping at `date &#8216;+%d\/%m\/%y %H:%M:%S&#8217;`&#187; &gt;&gt;$LOG<\/p>\n<p>#make snapshot and ufsdump it.<\/p>\n<p>ufsdump 0uf $ARCHIVE `fssnap -F ufs -o raw,bs=$SNAPSHOT $TOBACKUP` &gt;&gt;$LOG 2&gt;&amp;1 || raise_err &#171;cannot dump&#187;<\/p>\n<p>#wait to ufsdump end job<br \/>\nwhile true; do<br \/>\nps -ef |grep &#171;ufsdump&#187; &gt;\/dev\/null || break<br \/>\nsleep 180<br \/>\ndone<\/p>\n<p>#delete snapshot<br \/>\nfssnap -F ufs -d\u00a0 $TOBACKUP\u00a0 &gt;&gt;$LOG 2&gt;&amp;1 || raise_err &#171;cannot kill snapshot&#187;<\/p>\n<p>echo &#171;End dumping at `date &#8216;+%d\/%m\/%y %H:%M:%S&#8217;`&#187; &gt;&gt;$LOG<\/p>\n<p>\u041a\u0430\u0447\u0430\u0442\u044c [<a href=\"https:\/\/www.unixpin.com\/wp-content\/uploads\/2009\/06\/dmpfssh1.txt\">dmpfssh1<\/a>]<\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u043e\u0447\u0435\u043d\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u043f\u0440\u043e \u0431\u0430\u043a\u0430\u043f\u044b \u0435\u0441\u0442\u044c \u043d\u0430 \u043d\u0430\u0448\u0435\u043c \u0441\u0430\u0439\u0442\u0435 [<a href=\"https:\/\/www.unixpin.com\/2008\/05\/21\/remote-backup\/\">\u0447\u0438\u0442\u0430\u0442\u044c<\/a>].<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0421\u0442\u0430\u0440\u044b\u0439 \u0434\u0435\u0434\u043e\u0432\u0441\u043a\u0438\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u043e \u0437\u0430\u0431\u0430\u043a\u0430\u043f\u0438\u0442\u044c \u0444\u0430\u0439\u043b\u043e\u0432\u0443\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u0443 ufs. \u0421\u043f\u043e\u0441\u043e\u0431 \u043f\u043e\u0434\u043d\u044f\u0442\u044b\u0439 \u0438\u0437 \u043c\u0430\u043d\u043e\u0432 ;) \u0420\u0435\u0448\u0438\u043b \u0437\u0430\u043f\u043e\u0441\u0442\u0438\u0442\u044c, \u0447\u0442\u043e\u0431\u044b \u043b\u0435\u0433\u0447\u0435 \u0431\u044b\u043b\u043e \u0438\u0441\u043a\u0430\u0442\u044c. \u041d\u043e \u0438 \u0432\u0434\u0440\u0443\u0433 \u043a\u043e\u043c\u0443 \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u0441\u044f? ;)<\/p>\n","protected":false},"author":8,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,25,4,93],"tags":[337,54,657,207,53,656,641,697,699,698,346],"class_list":["post-430","post","type-post","status-publish","format-standard","hentry","category-shell","category-linux","category-solaris","category-unix-tru64","tag-backup","tag-filesystem","tag-fssnap","tag-script","tag-snapshot","tag-ufsdump","tag-641","tag-697","tag-699","tag-698","tag-346"],"_links":{"self":[{"href":"https:\/\/www.unixpin.com\/index.php?rest_route=\/wp\/v2\/posts\/430","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.unixpin.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.unixpin.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.unixpin.com\/index.php?rest_route=\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/www.unixpin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=430"}],"version-history":[{"count":12,"href":"https:\/\/www.unixpin.com\/index.php?rest_route=\/wp\/v2\/posts\/430\/revisions"}],"predecessor-version":[{"id":686,"href":"https:\/\/www.unixpin.com\/index.php?rest_route=\/wp\/v2\/posts\/430\/revisions\/686"}],"wp:attachment":[{"href":"https:\/\/www.unixpin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=430"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.unixpin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=430"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.unixpin.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=430"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}