<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
		xmlns:xhtml="http://www.w3.org/1999/xhtml"
>

<channel>
	<title>おれ最前線ねっと &#187; バックアップ</title>
	<atom:link href="http://ore.saizensen.net/archives/tag/%e3%83%90%e3%83%83%e3%82%af%e3%82%a2%e3%83%83%e3%83%97/feed" rel="self" type="application/rss+xml" />
	<link>http://ore.saizensen.net</link>
	<description>イェ〜〜ィ。見てる〜〜〜？？</description>
	<lastBuildDate>Tue, 12 Jul 2011 06:31:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.3</generator>
<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://ore.saizensen.net/archives/tag/%e3%83%90%e3%83%83%e3%82%af%e3%82%a2%e3%83%83%e3%83%97/feed" />
		<item>
		<title>[CentOS]Unisonをインストールして同期バックアップする。[Unison]</title>
		<link>http://ore.saizensen.net/archives/239</link>
		<comments>http://ore.saizensen.net/archives/239#comments</comments>
		<pubDate>Tue, 28 Jul 2009 17:20:01 +0000</pubDate>
		<dc:creator>bubbkis</dc:creator>
				<category><![CDATA[CentOS]]></category>
		<category><![CDATA[UNIX]]></category>
		<category><![CDATA[インストールメモ]]></category>
		<category><![CDATA[バックアップ]]></category>

		<guid isPermaLink="false">http://ore.saizensen.net/?p=239</guid>
		<description><![CDATA[土曜日に1TBのHDを買って来たのでCentOSサーバー(ore.saizensen.net)へ追加するとです。 今、付いてる古いHDをバックアップ専用として同期バックアップを行うとです。 Yumでunisonをインスト [...]]]></description>
			<content:encoded><![CDATA[				<p>土曜日に1TBのHDを買って来たのでCentOSサーバー(ore.saizensen.net)へ追加するとです。<br />
				今、付いてる古いHDをバックアップ専用として同期バックアップを行うとです。</p>
				<ol>
				<li>Yumで<strong>unison</strong>をインストール。
				<pre># yum -y install unison</pre>
</li>
<li>同期設定をつくる。
<pre># vi /root/unison.sh</pre>
				<pre>
#!/bin/bash

LANG=C

unison /backup /storage_1/backup -batch -owner -group -force /backup -fastcheck false
unison /storage_2/develop /storage_1/develop -batch -owner -group -force /storage_2/develop -fastcheck false
</pre>
				<p>こんな感じ。<br />
				一番上の例だと、<strong>/storage_2/develop</strong> を <strong>/storage_1/develop</strong> へ同期します。<br />
				また同期先（この例だと<strong>/storage_1/develop</strong>）のdevelopディレクトリは先に作成しておきます。<br />
				※以下オプション詳細↓<br />
				-batch:バッチ処理します。何も聞かれずに最後まで終了します。<br />
				-owner:オーナー情報も同期します。<br />
				-group:グループ情報も同期します。<br />
				-force xxx:指定したディレクトリを基準にして同期します。ミラーリングのような動作です。<br />
				-fastcheck {true,false,defalut}:trueの場合、ファイルの日付で比較します。unixの場合のデフォルトの動作です。心配ならばfalseでチェックしましょう。</p>
				<pre># chmod 700 /root/unison.sh</pre>
</li>
<li>cronへ登録。
<pre>#crontab -e</pre>
				<pre>00 05 * * * /root/unison.sh</pre>
</li>
</ol>
<p>おわり。<br />
そういや、iphone3GS買いました。発売日の次の日に。<br />
macbookのUSキーボードモデルは買ってもらいました。月曜、うちの社長に。</p>
<p>なにしよーかなーなにしよーかなー</p>
]]></content:encoded>
			<wfw:commentRss>http://ore.saizensen.net/archives/239/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://ore.saizensen.net/archives/239" />
	</item>
		<item>
		<title>PHPからPostgreSQLをdumpする。</title>
		<link>http://ore.saizensen.net/archives/33</link>
		<comments>http://ore.saizensen.net/archives/33#comments</comments>
		<pubDate>Mon, 04 Feb 2008 06:54:35 +0000</pubDate>
		<dc:creator>bubbkis</dc:creator>
				<category><![CDATA[DB]]></category>
		<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[dump]]></category>
		<category><![CDATA[バックアップ]]></category>

		<guid isPermaLink="false">http://ore.saizensen.net/archives/33</guid>
		<description><![CDATA[system&#40;&#34;/usr/bin/pg_dump -u $db_name &#60; $input_file &#62; $out_file&#34;&#41;; $input_fileには、 postg [...]]]></description>
			<content:encoded><![CDATA[				
				<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">system</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/usr/bin/pg_dump -u <span style="color: #006699; font-weight: bold;">$db_name</span> &lt; <span style="color: #006699; font-weight: bold;">$input_file</span> &gt; <span style="color: #006699; font-weight: bold;">$out_file</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>$input_fileには、</p>
<p>postgres(ユーザー名)<br />
abdedfg(パスワード)</p>
<p>の2行の形でファイルを作る。</p>
]]></content:encoded>
			<wfw:commentRss>http://ore.saizensen.net/archives/33/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://ore.saizensen.net/archives/33" />
	</item>
		<item>
		<title>PostgresのDBデータをファイルでバックアップ</title>
		<link>http://ore.saizensen.net/archives/32</link>
		<comments>http://ore.saizensen.net/archives/32#comments</comments>
		<pubDate>Mon, 04 Feb 2008 05:15:00 +0000</pubDate>
		<dc:creator>bubbkis</dc:creator>
				<category><![CDATA[DB]]></category>
		<category><![CDATA[PostgreSQL]]></category>
		<category><![CDATA[バックアップ]]></category>

		<guid isPermaLink="false">http://ore.saizensen.net/archives/32</guid>
		<description><![CDATA[ファイルでバックアップ /usr/local/pgsql/bin/pg_dump -h localhost -U postgres -d DB名 &#62; ファイル名 外部ファイルへテーブルの値をエクスポート COPY  [...]]]></description>
			<content:encoded><![CDATA[				<p>ファイルでバックアップ</p>
				<blockquote><p>/usr/local/pgsql/bin/pg_dump -h localhost -U postgres -d DB名 &gt; ファイル名</p></blockquote>
				<p>外部ファイルへテーブルの値をエクスポート</p>
				<blockquote><p>COPY テーブル名 TO &#8216;/home/postgres/ファイル名&#8217; USING DELIMITERS &#8216;,&#8217; ;</p></blockquote>
				<p>カレントディレクトリにエクスポート</p>
				<blockquote><p>\COPY テーブル名 TO &#8216;ファイル名&#8217; USING DELIMITERS &#8216;,&#8217; ;</p></blockquote>
				<p>外部ファイルからテーブルに値をインポートする</p>
				<blockquote><p>COPY テーブル名 FROM &#8216;/home/postgres/ファイル名&#8217; USING DELIMITERS &#8216;,&#8217; ;</p></blockquote>
				<p>ちなみにCSVでエクスポートする場合にカラム名をヘッダーに表示する場合</p>
				<blockquote><p>COPY テーブル名 TO &#8216;/home/postgres/ファイル名&#8217; HEADER CSV;</p></blockquote>
				<p>これで一行目にカラム名が挿入されてCSVでエクスポートされる。</p>
]]></content:encoded>
			<wfw:commentRss>http://ore.saizensen.net/archives/32/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://ore.saizensen.net/archives/32" />
	</item>
	</channel>
</rss>

