{"id":2406,"date":"2020-10-23T23:40:42","date_gmt":"2020-10-23T15:40:42","guid":{"rendered":"http:\/\/blog.ywdevops.cn\/?p=2406"},"modified":"2020-10-23T23:41:11","modified_gmt":"2020-10-23T15:41:11","slug":"linux-3","status":"publish","type":"post","link":"https:\/\/blog.ywdevops.cn\/index.php\/2020\/10\/23\/linux-3\/","title":{"rendered":"linux\u6587\u4ef6\u5907\u4efd\u811a\u672c"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\u4e0b\u9762\u811a\u672c\u4e3alinux\u7cfb\u7edf\u4e2d\u5907\u4efd\u6587\u4ef6\u7684\u811a\u672c\uff0c\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#!\/bin\/bash\n: '\n\u7528\u9014\uff1a\u672c\u811a\u672c\u4e3b\u8981\u7528\u4e8e\u5907\u4efd\u5f55\u97f3\u670d\u52a1\u5668\u6587\u4ef6\u5df2\u505a\u5b9a\u65f6\u4efb\u52a1\n\u521b\u5efa\u65f6\u95f4\uff1a20201022\n'\nbackup=\"\/data\/luyinbackup\"        #\u5907\u4efd\u6587\u4ef6\u5939\nsourcefile=\"\/data\/recording\"      #\u6e90\u6587\u4ef6\u5939\ncd ${sourcefile}\/\n#\u6309\u7167\u4fee\u6539\u65f6\u95f4\u8fdb\u884c\u6392\u5e8f\uff0c\u5e76\u6253\u5370\u6587\u4ef6\u540d\u5b57\nsortt=$(ls -lt | tail -n 1 | awk '{print $9}')\nif [ -d $backup ];then\n  zip -r  ${backup}\/${sortt}.zip   ${sortt} 2>&amp;1 \/data\/luyinbackup\/error.log\n   if [ $? -eq 0 ];then\n      echo \">>>>>>backup-success&lt;&lt;&lt;&lt;&lt;\"\n      echo \">>>>>>delete sourcefile&lt;&lt;&lt;&lt;&lt;\"\n      rm -rf ${sortt}\n   else\n     echo \">>>>>>>faild&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;\"\n   fi\nfi<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u4e0b\u9762\u811a\u672c\u4e3alinux\u7cfb\u7edf\u4e2d\u5907\u4efd\u6587\u4ef6\u7684\u811a\u672c\uff0c\u5982\u4e0b\uff1a<\/p>\n","protected":false},"author":3,"featured_media":2403,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[107,29],"tags":[],"class_list":["post-2406","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-script","category-yunwei"],"blocksy_meta":{"styles_descriptor":{"styles":{"desktop":"","tablet":"","mobile":""},"google_fonts":[],"version":8}},"_links":{"self":[{"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/posts\/2406","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/comments?post=2406"}],"version-history":[{"count":2,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/posts\/2406\/revisions"}],"predecessor-version":[{"id":2408,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/posts\/2406\/revisions\/2408"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/media\/2403"}],"wp:attachment":[{"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/media?parent=2406"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/categories?post=2406"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/tags?post=2406"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}