{"id":394,"date":"2008-02-02T22:27:41","date_gmt":"2008-02-02T13:27:41","guid":{"rendered":"http:\/\/153.126.194.20\/?p=394"},"modified":"2024-11-17T15:23:39","modified_gmt":"2024-11-17T06:23:39","slug":"ubuntu-data_backup","status":"publish","type":"post","link":"https:\/\/funaori.com\/ja\/2008\/02\/02\/ubuntu-data_backup\/","title":{"rendered":"ubuntu\/data_backup"},"content":{"rendered":"<h2 id=\"content_1_0\">\u5225\u30b5\u30fc\u30d0\u306brsync  <a class=\"anchor_super\" id=\"u20c554d\" href=\"http:\/\/192.168.1.4\/www_old\/linux\/index.php?ubuntu%2Fdata_backup#u20c554d\" title=\"u20c554d\">\u2020<\/a><\/h2>\n<p><a href=\"http:\/\/www2s.biglobe.ne.jp\/~nuts\/labo\/inti\/cron-rsync-ssh-nodaemon.html\" rel=\"nofollow\">rsync + cron + ssh \uff08rsyncd \u3092\u7acb\u3066\u306a\u3044\u7de8\uff09<\/a><\/p>\n<div class=\"jumpmenu\"><a href=\"#navigator\">\u2191<\/a><\/div>\n<h3 id=\"content_1_1\">\u30b3\u30de\u30f3\u30c9\u306e\u9650\u5b9a  <a class=\"anchor_super\" id=\"p12be281\" href=\"http:\/\/192.168.1.4\/www_old\/linux\/index.php?ubuntu%2Fdata_backup#p12be281\" title=\"p12be281\">\u2020<\/a><\/h3>\n<p>\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u5148\u306e\u30b5\u30fc\u30d0\u306b\u3066,root\u30a2\u30ab\u30a6\u30f3\u30c8\u3067\u306essh\u3092\u516c\u958b\u9375\u306b\u6307\u5b9a\u3057\u305f\u30b3\u30de\u30f3\u30c9\u306b\u9650\u5b9a\u3059\u308b.\/etc\/ssh\/sshd_config\u3092\u7de8\u96c6\u3059\u308b.<\/p>\n<pre>PermitRootLogin forced-commands-only<\/pre>\n<div class=\"jumpmenu\"><a href=\"#navigator\">\u2191<\/a><\/div>\n<h3 id=\"content_1_2\">ssh\u306e\u9375\u4f5c\u6210  <a class=\"anchor_super\" id=\"hbb75d04\" href=\"http:\/\/192.168.1.4\/www_old\/linux\/index.php?ubuntu%2Fdata_backup#hbb75d04\" title=\"hbb75d04\">\u2020<\/a><\/h3>\n<p>\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u5148\u306e\u30b5\u30fc\u30d0\u306b\u3066,ssh-keygen\u30b3\u30de\u30f3\u30c9\u306b\u30662\u30da\u30a2(rsync\u7528,shutdown\u7528)\u306e\u30d1\u30b9\u30ef\u30fc\u30c9\u7121\u3057\u306e\u9375\u3092\u4f5c\u6210\u3059\u308b.<br \/>\n\u79d8\u5bc6\u9375\u306fUSB\u30e1\u30e2\u30ea\u306a\u3069\u3067\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u5143\u306b\u79fb\u52d5\u3059\u308b.<\/p>\n<div class=\"jumpmenu\"><a href=\"#navigator\">\u2191<\/a><\/div>\n<h4 id=\"content_1_3\">\u30b3\u30de\u30f3\u30c9\u306e\u767b\u9332  <a class=\"anchor_super\" id=\"u8ddbfcc\" href=\"http:\/\/192.168.1.4\/www_old\/linux\/index.php?ubuntu%2Fdata_backup#u8ddbfcc\" title=\"u8ddbfcc\">\u2020<\/a><\/h4>\n<ul class=\"list1\" style=\"padding-left:16px;margin-left:16px\">\n<li>\u4f5c\u6210\u3057\u305f\u516c\u958b\u9375\u3092\u767b\u9332\u3059\u308b.\n<pre># cat \/root\/.ssh\/rsync.pub &gt;&gt; \/root\/.ssh\/authorized_keys\r\n# cat \/root\/.ssh\/shutdown.pub &gt;&gt; \/root\/.ssh\/authorized_keys<\/pre>\n<\/li>\n<li>rsync\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5f97\u308b<br \/>\n\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u5143\u3067\u5b9f\u884c\u3092\u3057\u305f\u3044rsync\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066,\u767b\u9332\u3059\u308b\u30b3\u30de\u30f3\u30c9\u3092\u5f97\u308b.<\/p>\n<pre># rsync -vv -aurvop -H --delete-e \"ssh -i \/root\/.ssh\/rsync\" \/home\/backup\/ root@remote:\/home\/backup\/\r\nPassword:\r\nopening connection using ssh -i \/root\/.ssh\/rsync -l root remote.example.com rsync --server -vvulHogDtprz --delete . \/home\/backup\/ <\/pre>\n<p>rsync\u4ee5\u964d\u304c\u767b\u9332\u3092\u3059\u308b\u30b3\u30de\u30f3\u30c9\u306b\u306a\u308b<\/li>\n<li>\u30b3\u30de\u30f3\u30c9\u306e\u767b\u9332<br \/>\n\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u5148\u306e\/root\/.ssh\/authorized_keys\u306e\u4e00\u3064\u3081\u306e\u9375\u306e\u5192\u982d\u306b\u30b3\u30de\u30f3\u30c9\u306e\u6307\u5b9a\u3092\u8ffd\u52a0\u3059\u308b.<\/p>\n<pre>command=\"rsync --server -vvulHogDtprz --delete . \/home\/backup\/\" ssh-rsa AAAA..........<\/pre>\n<p>\u307e\u305f\u4e8c\u3064\u3081\u306e\u9375\u306b\u306fshutdown\u30b3\u30de\u30f3\u30c9\u3092\u767b\u9332\u3059\u308b.<\/p>\n<pre>command=\"shutdown -h now\" ssh-rsa AAAA....<\/pre>\n<\/li>\n<\/ul>\n<div class=\"jumpmenu\"><a href=\"#navigator\">\u2191<\/a><\/div>\n<h4 id=\"content_1_4\">\u30b3\u30de\u30f3\u30c9\u306e\u30c6\u30b9\u30c8  <a class=\"anchor_super\" id=\"m066e244\" href=\"http:\/\/192.168.1.4\/www_old\/linux\/index.php?ubuntu%2Fdata_backup#m066e244\" title=\"m066e244\">\u2020<\/a><\/h4>\n<p>rsync\u306e\u30b3\u30de\u30f3\u30c9\u306f\u30b3\u30de\u30f3\u30c9\u3092\u5f97\u308b\u3068\u304d\u306b\u4f7f\u3063\u305f\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b.\uff08\u30c7\u30d0\u30c3\u30b0\u306e\u30ec\u30d9\u30eb\u3092\u4e0b\u3052\u3066\u3082\u3088\u3044\uff09<\/p>\n<pre># rsync -vv -aurvop -H --delete-e \"ssh -i \/root\/.ssh\/rsync\" \/home\/backup\/ root@remote:\/home\/backup\/<\/pre>\n<p>shutdown\u306e\u30b3\u30de\u30f3\u30c9\u306fssh\u306b\u30b3\u30de\u30f3\u30c9\u3092\u8ffd\u52a0\u3057\u3066\u9001\u4fe1\u3059\u308b.<\/p>\n<pre># \/ssh -i \/root\/.ssh\/shutdown root@remote \"shutdown -h now\"<\/pre>\n<div class=\"jumpmenu\"><a href=\"#navigator\">\u2191<\/a><\/div>\n<h2 id=\"content_1_5\">\u30b9\u30af\u30ea\u30d7\u30c8\u5316  <a class=\"anchor_super\" id=\"q108b4f2\" href=\"http:\/\/192.168.1.4\/www_old\/linux\/index.php?ubuntu%2Fdata_backup#q108b4f2\" title=\"q108b4f2\">\u2020<\/a><\/h2>\n<p>\u81ea\u52d5\u7684\u306b\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u5148\u306e\u30b5\u30fc\u30d0\u304c\u843d\u3061\u3066\u3044\u308b\u6642\u306f\u8d77\u52d5\u3057\u3066\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u3059\u308b\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u4f5c\u6210\u3059\u308b.<\/p>\n<div class=\"jumpmenu\"><a href=\"#navigator\">\u2191<\/a><\/div>\n<h3 id=\"content_1_6\">\u30b3\u30d4\u30fc\u5148\u306e\u63a5\u7d9a\u78ba\u8a8d  <a class=\"anchor_super\" id=\"kc880d49\" href=\"http:\/\/192.168.1.4\/www_old\/linux\/index.php?ubuntu%2Fdata_backup#kc880d49\" title=\"kc880d49\">\u2020<\/a><\/h3>\n<pre>ping $ip -c 4\r\nif [ $? -ne 0 ];\r\nthen<\/pre>\n<div class=\"jumpmenu\"><a href=\"#navigator\">\u2191<\/a><\/div>\n<h3 id=\"content_1_7\">WOL\u3067\u8d77\u52d5  <a class=\"anchor_super\" id=\"z90f0db4\" href=\"http:\/\/192.168.1.4\/www_old\/linux\/index.php?ubuntu%2Fdata_backup#z90f0db4\" title=\"z90f0db4\">\u2020<\/a><\/h3>\n<p><a href=\"http:\/\/ubuntuforums.org\/showthread.php?t=234588\" rel=\"nofollow\"> HOWTO: Set your system up for Wake On LAN (WOL) <\/a><br \/>\n<a href=\"http:\/\/80286.blog62.fc2.com\/blog-entry-37.html\" rel=\"nofollow\">Wake on LAN\u3092\u8a2d\u5b9a\u3059\u308b<\/a><\/p>\n<div class=\"jumpmenu\"><a href=\"#navigator\">\u2191<\/a><\/div>\n<h4 id=\"content_1_8\">ethtool\u306e\u8a2d\u5b9a  <a class=\"anchor_super\" id=\"q8054e9f\" href=\"http:\/\/192.168.1.4\/www_old\/linux\/index.php?ubuntu%2Fdata_backup#q8054e9f\" title=\"q8054e9f\">\u2020<\/a><\/h4>\n<p>\u5e38\u306bWakeup On LAN\u306b\u53cd\u5fdc\u3059\u308b\u3088\u3046\u306bethtool\u306b\u3066LAN\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u5909\u66f4\u3059\u308b.<br \/>\n\/etc\/init.d\/wakeonlanconfig\u3092\u4f5c\u6210<\/p>\n<pre>#!\/bin\/bash\r\n\/usr\/sbin\/ethtool -s eth0 wol g\r\nexit<\/pre>\n<p>\u5b9f\u884c\u6a29\u9650\u3092\u4e0e\u3048\u308b<\/p>\n<pre># chmod a+x wakeonlanconfig<\/pre>\n<p>\u30b9\u30bf\u30fc\u30c8\u30a2\u30c3\u30d7\u3067\u5b9f\u884c\u3055\u308c\u308b\u3088\u3046\u306b\u5909\u66f4\u3059\u308b.<\/p>\n<pre>#update-rc.d -f wakeonlanconfig defaults<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u5225\u30b5\u30fc\u30d0\u306brsync \u2020 rsync + cron + ssh \uff08rsyncd \u3092\u7acb\u3066\u306a\u3044\u7de8\uff09 \u2191 \u30b3\u30de\u30f3\u30c9\u306e\u9650\u5b9a \u2020 \u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u5148\u306e\u30b5\u30fc\u30d0\u306b\u3066,root\u30a2\u30ab\u30a6\u30f3\u30c8\u3067\u306essh\u3092\u516c\u958b\u9375\u306b\u6307\u5b9a\u3057\u305f\u30b3\u30de\u30f3\u30c9\u306b\u9650\u5b9a\u3059\u308b.\/et&hellip; <a class=\"more-link\" href=\"https:\/\/funaori.com\/ja\/2008\/02\/02\/ubuntu-data_backup\/\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"screen-reader-text\">ubuntu\/data_backup<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_locale":"ja","_original_post":"394","footnotes":""},"categories":[14],"tags":[],"class_list":["post-394","post","type-post","status-publish","format-standard","hentry","category-ubuntu","ja","entry"],"_links":{"self":[{"href":"https:\/\/funaori.com\/wp-json\/wp\/v2\/posts\/394","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/funaori.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/funaori.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/funaori.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/funaori.com\/wp-json\/wp\/v2\/comments?post=394"}],"version-history":[{"count":1,"href":"https:\/\/funaori.com\/wp-json\/wp\/v2\/posts\/394\/revisions"}],"predecessor-version":[{"id":395,"href":"https:\/\/funaori.com\/wp-json\/wp\/v2\/posts\/394\/revisions\/395"}],"wp:attachment":[{"href":"https:\/\/funaori.com\/wp-json\/wp\/v2\/media?parent=394"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/funaori.com\/wp-json\/wp\/v2\/categories?post=394"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/funaori.com\/wp-json\/wp\/v2\/tags?post=394"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}