<?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/"
	>

<channel>
	<title>fengcool.com &#187; Linux</title>
	<atom:link href="http://www.fengcool.com/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.fengcool.com</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Wed, 25 Jan 2012 19:09:58 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>untar all files in a directory</title>
		<link>http://www.fengcool.com/2012/01/untar-all-files-in-a-directory/</link>
		<comments>http://www.fengcool.com/2012/01/untar-all-files-in-a-directory/#comments</comments>
		<pubDate>Wed, 25 Jan 2012 19:09:40 +0000</pubDate>
		<dc:creator>rick</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[tar]]></category>
		<category><![CDATA[untar]]></category>

		<guid isPermaLink="false">http://www.fengcool.com/?p=186</guid>
		<description><![CDATA[for i in *.tar.gz; do echo extracting $i; tar xvzf $i ;
]]></description>
			<content:encoded><![CDATA[<p>for i in *.tar.gz; do echo extracting $i; tar xvzf $i ;</p>
<a rel="external nofollow" class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.fengcool.com%2F2012%2F01%2Funtar-all-files-in-a-directory%2F&amp;linkname=untar%20all%20files%20in%20a%20directory"><img src="http://www.fengcool.com/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Save/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.fengcool.com/2012/01/untar-all-files-in-a-directory/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VirtualBox Fedora 13 install guest additions</title>
		<link>http://www.fengcool.com/2010/10/virtualbox-fedora-13-install-guest-additions/</link>
		<comments>http://www.fengcool.com/2010/10/virtualbox-fedora-13-install-guest-additions/#comments</comments>
		<pubDate>Fri, 22 Oct 2010 13:57:56 +0000</pubDate>
		<dc:creator>Nelson</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.fengcool.com/?p=184</guid>
		<description><![CDATA[Install packages needed
yum -y install kernel-devel kernel-headers dkms gcc gcc-c++
in VirtualBox devices, select install guest additions
sh VBoxLinuxAdditions.run 
]]></description>
			<content:encoded><![CDATA[<p>Install packages needed</p>
<p>yum -y install kernel-devel kernel-headers dkms gcc gcc-c++<br />
in VirtualBox devices, select install guest additions<br />
sh VBoxLinuxAdditions.run </p>
<a rel="external nofollow" class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.fengcool.com%2F2010%2F10%2Fvirtualbox-fedora-13-install-guest-additions%2F&amp;linkname=VirtualBox%20Fedora%2013%20install%20guest%20additions"><img src="http://www.fengcool.com/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Save/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.fengcool.com/2010/10/virtualbox-fedora-13-install-guest-additions/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>VirtualBox Fedora 13 guest use shared folder</title>
		<link>http://www.fengcool.com/2010/10/virtualbox-fedora-12-guest-use-shared-folder/</link>
		<comments>http://www.fengcool.com/2010/10/virtualbox-fedora-12-guest-use-shared-folder/#comments</comments>
		<pubDate>Fri, 22 Oct 2010 13:54:32 +0000</pubDate>
		<dc:creator>Nelson</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.fengcool.com/?p=180</guid>
		<description><![CDATA[Fedora 13 as guest OS on a Windows 7 host

Add a shared folder in virtualbox&#8217;s devices settings.
create a folder &#8220;Shared&#8221; in fedora
su –c “mount.vboxsf Shared ~/Shared -o rw,exec,uid=1000,gid=1000,dev”
]]></description>
			<content:encoded><![CDATA[<p><strong>Fedora 13 as guest OS on a Windows 7 host<br />
</strong></p>
<p>Add a shared folder in virtualbox&#8217;s devices settings.<br />
create a folder &#8220;Shared&#8221; in fedora<br />
su –c “mount.vboxsf Shared ~/Shared -o rw,exec,uid=1000,gid=1000,dev”</p>
<a rel="external nofollow" class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.fengcool.com%2F2010%2F10%2Fvirtualbox-fedora-12-guest-use-shared-folder%2F&amp;linkname=VirtualBox%20Fedora%2013%20guest%20use%20shared%20folder"><img src="http://www.fengcool.com/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Save/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.fengcool.com/2010/10/virtualbox-fedora-12-guest-use-shared-folder/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Create multiple volumn zip backup with MD5 check</title>
		<link>http://www.fengcool.com/2010/10/create-multiple-volumn-zip-backup-with-md5-check/</link>
		<comments>http://www.fengcool.com/2010/10/create-multiple-volumn-zip-backup-with-md5-check/#comments</comments>
		<pubDate>Fri, 22 Oct 2010 13:48:58 +0000</pubDate>
		<dc:creator>Nelson</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.fengcool.com/?p=178</guid>
		<description><![CDATA[Download and install p7zip:
http://p7zip.sourceforge.net/
Then use 7z
Code:

7z a -v50m test.zip your-big-file-paths

this makes 50 MB volumes called
Code:
test.zip.001  test.zip.002  test.zip.003  test.zip.004
To extract them just run
Code:

7z x test.zip.001

make md5

# md5sum test.zip.* > MD5SUM
# cat MD5SUM
cb16175f4acad02f977f74d5c142879b  test.zip.001
33c745ca49ab6e63b727658ec148cf67  test.zip.002
14e6952b632fbb7f4c0731067afdb46c  test.zip.003
....

check md5

# md5sum --check MD5SUM

]]></description>
			<content:encoded><![CDATA[<p>Download and install p7zip:<br />
http://p7zip.sourceforge.net/</p>
<p>Then use 7z<br />
Code:<br />
<code><br />
7z a -v50m test.zip your-big-file-paths<br />
</code><br />
this makes 50 MB volumes called<br />
Code:</p>
<p>test.zip.001  test.zip.002  test.zip.003  test.zip.004</p>
<p>To extract them just run<br />
Code:</p>
<p><code><br />
7z x test.zip.001<br />
</code></p>
<p>make md5<br />
<code><br />
# md5sum test.zip.* > MD5SUM<br />
# cat MD5SUM<br />
cb16175f4acad02f977f74d5c142879b  test.zip.001<br />
33c745ca49ab6e63b727658ec148cf67  test.zip.002<br />
14e6952b632fbb7f4c0731067afdb46c  test.zip.003<br />
....<br />
</code><br />
check md5<br />
<code><br />
# md5sum --check MD5SUM<br />
</code></p>
<a rel="external nofollow" class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.fengcool.com%2F2010%2F10%2Fcreate-multiple-volumn-zip-backup-with-md5-check%2F&amp;linkname=Create%20multiple%20volumn%20zip%20backup%20with%20MD5%20check"><img src="http://www.fengcool.com/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Save/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.fengcool.com/2010/10/create-multiple-volumn-zip-backup-with-md5-check/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SVN make a sub folder to a seperate new repository</title>
		<link>http://www.fengcool.com/2010/10/svn-make-a-sub-folder-to-a-seperate-new-repository/</link>
		<comments>http://www.fengcool.com/2010/10/svn-make-a-sub-folder-to-a-seperate-new-repository/#comments</comments>
		<pubDate>Fri, 22 Oct 2010 13:41:21 +0000</pubDate>
		<dc:creator>Nelson</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.fengcool.com/?p=176</guid>
		<description><![CDATA[
svnadmin dump /svn/old_repos > ./repository.dump
svndumpfilter include path/to/docs --drop-empty-revs --renumber-revs --preserve-revprops < ./repository.dump > ./docs_only.dump
svnadmin load /svn/new_repos < ./docs_only.dump

]]></description>
			<content:encoded><![CDATA[<p><code><br />
svnadmin dump /svn/old_repos > ./repository.dump<br />
svndumpfilter include path/to/docs --drop-empty-revs --renumber-revs --preserve-revprops < ./repository.dump > ./docs_only.dump<br />
svnadmin load /svn/new_repos < ./docs_only.dump<br />
</code></p>
<a rel="external nofollow" class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.fengcool.com%2F2010%2F10%2Fsvn-make-a-sub-folder-to-a-seperate-new-repository%2F&amp;linkname=SVN%20make%20a%20sub%20folder%20to%20a%20seperate%20new%20repository"><img src="http://www.fengcool.com/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Save/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.fengcool.com/2010/10/svn-make-a-sub-folder-to-a-seperate-new-repository/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Open and edit files from remote server</title>
		<link>http://www.fengcool.com/2010/10/open-and-edit-files-from-remote-server/</link>
		<comments>http://www.fengcool.com/2010/10/open-and-edit-files-from-remote-server/#comments</comments>
		<pubDate>Tue, 19 Oct 2010 14:07:42 +0000</pubDate>
		<dc:creator>rick</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.fengcool.com/?p=168</guid>
		<description><![CDATA[In my workplace, every developer needs to work on own directory in a shared dev server. 
Here is the command I ran to open my directory and edit my files remotely.

1
sshfs username@192.168.0.6:/remote/directory/path /mount/to/your/local/directory/path

* 192.168.0.6 is IP of remote server.
After you ran this, access to /mount/to/your/local/directory/path directory is same as access to remote directory.
Have fun.  [...]]]></description>
			<content:encoded><![CDATA[<p>In my workplace, every developer needs to work on own directory in a shared dev server. </p>
<p>Here is the command I ran to open my directory and edit my files remotely.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">sshfs username<span style="color: #000000; font-weight: bold;">@</span>192.168.0.6:<span style="color: #000000; font-weight: bold;">/</span>remote<span style="color: #000000; font-weight: bold;">/</span>directory<span style="color: #000000; font-weight: bold;">/</span>path <span style="color: #000000; font-weight: bold;">/</span>mount<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>your<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>directory<span style="color: #000000; font-weight: bold;">/</span>path</pre></td></tr></table></div>

<p>* 192.168.0.6 is IP of remote server.</p>
<p>After you ran this, access to /mount/to/your/local/directory/path directory is same as access to remote directory.</p>
<p>Have fun. <img src='http://www.fengcool.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<a rel="external nofollow" class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.fengcool.com%2F2010%2F10%2Fopen-and-edit-files-from-remote-server%2F&amp;linkname=Open%20and%20edit%20files%20from%20remote%20server"><img src="http://www.fengcool.com/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Save/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.fengcool.com/2010/10/open-and-edit-files-from-remote-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Remove svn directories and files</title>
		<link>http://www.fengcool.com/2010/10/remove-svn-directories-and-files/</link>
		<comments>http://www.fengcool.com/2010/10/remove-svn-directories-and-files/#comments</comments>
		<pubDate>Tue, 19 Oct 2010 13:57:23 +0000</pubDate>
		<dc:creator>rick</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.fengcool.com/?p=165</guid>
		<description><![CDATA[Deleting all SVN files and directories is a headache if your project contains lots of directories. 
Here is a easy way to delete them with one command.

1
find /path/to/your/directory -type d -name .svn -exec rm -rf '{}' +

]]></description>
			<content:encoded><![CDATA[<p>Deleting all SVN files and directories is a headache if your project contains lots of directories. </p>
<p>Here is a easy way to delete them with one command.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">find</span> <span style="color: #000000; font-weight: bold;">/</span>path<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>your<span style="color: #000000; font-weight: bold;">/</span>directory <span style="color: #660033;">-type</span> d <span style="color: #660033;">-name</span> .svn <span style="color: #660033;">-exec</span> <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-rf</span> <span style="color: #ff0000;">'{}'</span> +</pre></td></tr></table></div>

<a rel="external nofollow" class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.fengcool.com%2F2010%2F10%2Fremove-svn-directories-and-files%2F&amp;linkname=Remove%20svn%20directories%20and%20files"><img src="http://www.fengcool.com/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Save/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.fengcool.com/2010/10/remove-svn-directories-and-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>cp file always getting overwrite prompt?</title>
		<link>http://www.fengcool.com/2009/11/cp-file-always-getting-overwrite-prompt/</link>
		<comments>http://www.fengcool.com/2009/11/cp-file-always-getting-overwrite-prompt/#comments</comments>
		<pubDate>Thu, 26 Nov 2009 05:32:09 +0000</pubDate>
		<dc:creator>rick</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[cp]]></category>
		<category><![CDATA[prompt]]></category>

		<guid isPermaLink="false">http://www.fengcool.com/?p=133</guid>
		<description><![CDATA[linux cp cannot remove overwrite prompt. force no prompt when copy a file.]]></description>
			<content:encoded><![CDATA[<p>wondering why always getting overwrite prompt when use &#8220;cp&#8221; command with &#8220;-f&#8221; option</p>
<p>try this,</p>
<p>1. login as root</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">vi</span> <span style="color: #000000; font-weight: bold;">/</span>root<span style="color: #000000; font-weight: bold;">/</span>.bashrc</pre></td></tr></table></div>

<p>2. comment out this line</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#alias cp='cp -i'</span></pre></td></tr></table></div>

<p>3. logout and login again</p>
<a rel="external nofollow" class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.fengcool.com%2F2009%2F11%2Fcp-file-always-getting-overwrite-prompt%2F&amp;linkname=cp%20file%20always%20getting%20overwrite%20prompt%3F"><img src="http://www.fengcool.com/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Save/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.fengcool.com/2009/11/cp-file-always-getting-overwrite-prompt/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Rsync server and client &#8211; backup your server files</title>
		<link>http://www.fengcool.com/2009/07/rsync_server_and_client_backup_server_file/</link>
		<comments>http://www.fengcool.com/2009/07/rsync_server_and_client_backup_server_file/#comments</comments>
		<pubDate>Thu, 30 Jul 2009 17:28:53 +0000</pubDate>
		<dc:creator>rick</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[rsync]]></category>
		<category><![CDATA[rsync client]]></category>
		<category><![CDATA[rsync server]]></category>

		<guid isPermaLink="false">http://www.fengcool.com/?p=112</guid>
		<description><![CDATA[rsync can synchronizes files and directories from one server to another. It's perfectly for backup or create a mirror site purpose.]]></description>
			<content:encoded><![CDATA[<p>rsync can synchronizes files and directories from one server to another. It&#8217;s perfectly for backup or create a mirror site purpose.</p>
<p>This tutorial shows you step by step to create a rsync server and client server.</p>
<p>First of all, you must have rsync installed. For fedora, rsync should be included by default. If you don&#8217;t have it, run</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">yum <span style="color: #c20cb9; font-weight: bold;">install</span> rsync</pre></td></tr></table></div>

<p><strong>Setup rsync server</strong></p>
<p>Create rsync configuration file:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>etc
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> rsyncd
<span style="color: #7a0874; font-weight: bold;">cd</span> rsyncd
<span style="color: #c20cb9; font-weight: bold;">touch</span> rsyncd.conf
<span style="color: #c20cb9; font-weight: bold;">touch</span> rsyncd.motd
<span style="color: #c20cb9; font-weight: bold;">touch</span> rsyncd.user
<span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">600</span> rsyncd.user</pre></td></tr></table></div>

<p>edit rsyncd.user file and create username and password:<br />
vi /etc/rsyncd/rsyncd.user</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">my_rsync_user_1:user_1_password</pre></td></tr></table></div>

<p>edit rsyncd.conf file:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">pid <span style="color: #007800;"><span style="color: #c20cb9; font-weight: bold;">file</span></span>=<span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>run<span style="color: #000000; font-weight: bold;">/</span>rsyncd.pid
<span style="color: #007800;">port</span>=<span style="color: #000000;">873</span>
<span style="color: #007800;">uid</span>=root
<span style="color: #007800;">gid</span>=root
use <span style="color: #007800;"><span style="color: #c20cb9; font-weight: bold;">chroot</span></span>=<span style="color: #c20cb9; font-weight: bold;">yes</span>
<span style="color: #c20cb9; font-weight: bold;">read</span> <span style="color: #007800;">only</span>=<span style="color: #c20cb9; font-weight: bold;">yes</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># limit access to LANS</span>
hosts <span style="color: #007800;">allow</span>=192.168.2.0<span style="color: #000000; font-weight: bold;">/</span>255.255.255.0   <span style="color: #666666; font-style: italic;">#default, listen to lan server</span>
host <span style="color: #007800;">deny</span>=<span style="color: #000000; font-weight: bold;">*</span>
&nbsp;
max <span style="color: #007800;">connections</span>=<span style="color: #000000;">5</span>
motd <span style="color: #007800;"><span style="color: #c20cb9; font-weight: bold;">file</span></span>=<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>rsyncd<span style="color: #000000; font-weight: bold;">/</span>rsyncd.motd
&nbsp;
log <span style="color: #007800;">format</span>=<span style="color: #000000; font-weight: bold;">%</span>t<span style="color: #000000; font-weight: bold;">%</span>a<span style="color: #000000; font-weight: bold;">%</span>m<span style="color: #000000; font-weight: bold;">%</span>f<span style="color: #000000; font-weight: bold;">%</span>b
syslog <span style="color: #007800;">facility</span>=local3
<span style="color: #007800;">timeout</span>=<span style="color: #000000;">300</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">&#91;</span>profile_1<span style="color: #7a0874; font-weight: bold;">&#93;</span>          <span style="color: #666666; font-style: italic;">#profile name</span>
path = <span style="color: #000000; font-weight: bold;">/</span>path<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>backup<span style="color: #000000; font-weight: bold;">/</span>directory
ignore errors
<span style="color: #c20cb9; font-weight: bold;">read</span> only = <span style="color: #c20cb9; font-weight: bold;">false</span>
list = <span style="color: #c20cb9; font-weight: bold;">false</span>
hosts allow = 66.66.66.66   <span style="color: #666666; font-style: italic;">#listen to client server which use public ip</span>
hosts deny = 0.0.0.0<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">32</span>
auth <span style="color: #c20cb9; font-weight: bold;">users</span> = my_rsync_user_1
secrets <span style="color: #c20cb9; font-weight: bold;">file</span> = <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>rsyncd<span style="color: #000000; font-weight: bold;">/</span>rsyncd.user
&nbsp;
<span style="color: #666666; font-style: italic;">#[profile_1]          #another profile name</span>
<span style="color: #666666; font-style: italic;">#path = /path/to/backup/directory/2</span>
<span style="color: #666666; font-style: italic;">#ignore errors</span>
<span style="color: #666666; font-style: italic;">#read only = false</span>
<span style="color: #666666; font-style: italic;">#list = false</span>
<span style="color: #666666; font-style: italic;">#hosts allow = 88.88.88.88   #listen to client server which use public ip</span>
<span style="color: #666666; font-style: italic;">#hosts deny = 0.0.0.0/32</span>
<span style="color: #666666; font-style: italic;">#auth users = my_rsync_user_2</span>
<span style="color: #666666; font-style: italic;">#secrets file = /etc/rsyncd/rsyncd.user</span></pre></td></tr></table></div>

<p>Next, create init start up script<br />
vi /etc/init.d/rsyncd</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Startup script for rsyncd daemon</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># chkconfig: 35 90 10</span>
<span style="color: #666666; font-style: italic;"># description: Server data for sync to other server</span>
<span style="color: #666666; font-style: italic;"># processname rsync</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Source function library</span>
. <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>rc.d<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>functions
&nbsp;
<span style="color: #007800;">prog</span>=rsync
<span style="color: #007800;">conf</span>=<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>rsyncd<span style="color: #000000; font-weight: bold;">/</span>rsyncd.conf
&nbsp;
<span style="color: #000000; font-weight: bold;">case</span> <span style="color: #ff0000;">&quot;$1&quot;</span> <span style="color: #000000; font-weight: bold;">in</span>
    start<span style="color: #7a0874; font-weight: bold;">&#41;</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">&quot;Starting rsync daemon: &quot;</span>
        daemon <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$prog</span> <span style="color: #660033;">--daemon</span> <span style="color: #660033;">--config</span>=<span style="color: #007800;">$conf</span>
        <span style="color: #007800;">RETVAL</span>=<span style="color: #007800;">$?</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span>
        <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$RETVAL</span> = <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #c20cb9; font-weight: bold;">touch</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lock<span style="color: #000000; font-weight: bold;">/</span>subsys<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$prog</span>
        <span style="color: #000000; font-weight: bold;">;;</span>
    stop<span style="color: #7a0874; font-weight: bold;">&#41;</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">&quot;Shutting down <span style="color: #007800;">$prog</span>: &quot;</span>
        killproc <span style="color: #660033;">-d</span> <span style="color: #000000;">60</span> <span style="color: #007800;">$prog</span>
        <span style="color: #007800;">RETVAL</span>=<span style="color: #007800;">$?</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span>
        <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$RETVAL</span> = <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-f</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lock<span style="color: #000000; font-weight: bold;">/</span>subsys<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$prog</span>
        <span style="color: #000000; font-weight: bold;">;;</span>
    status<span style="color: #7a0874; font-weight: bold;">&#41;</span>
        status <span style="color: #007800;">$prog</span>
        <span style="color: #000000; font-weight: bold;">;;</span>
    restart<span style="color: #7a0874; font-weight: bold;">&#41;</span>
        $<span style="color: #000000;">0</span> stop
        $<span style="color: #000000;">0</span> start
        <span style="color: #000000; font-weight: bold;">;;</span>
    <span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Usage: $0 {start|stop|restart|status}&quot;</span>
        <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">1</span>
<span style="color: #000000; font-weight: bold;">esac</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">0</span></pre></td></tr></table></div>

<p>make /etc/init.d/rsyncd executable, and register this service</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>3
4
5
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">chmod</span> +x <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>rsyncd 
<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>chkconfig <span style="color: #660033;">--add</span> rsyncd
<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>service rsyncd start</pre></td></tr></table></div>

<p><strong>Setup rsync client</strong></p>
<p>first, of course you must have rsync installed on client server</p>
<p>make rsync password file</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>etc
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> rsync
<span style="color: #7a0874; font-weight: bold;">cd</span> rsync
<span style="color: #c20cb9; font-weight: bold;">touch</span> rsync.pwd
<span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">600</span> rsync.pwd</pre></td></tr></table></div>

<p>vi /etc/rsync/rsync.pwd</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">user_1_password</pre></td></tr></table></div>

<p>execute this command to start synchronize file to server</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">rsync <span style="color: #660033;">-vrtLogp</span> <span style="color: #660033;">--progress</span> <span style="color: #000000; font-weight: bold;">/</span>path<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>directory<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>be<span style="color: #000000; font-weight: bold;">/</span>backup<span style="color: #000000; font-weight: bold;">/*</span> my_rsync_user_1<span style="color: #000000; font-weight: bold;">@</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>SERVER_IP<span style="color: #7a0874; font-weight: bold;">&#93;</span>::profile_1 <span style="color: #660033;">--password-file</span>=<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>rsync<span style="color: #000000; font-weight: bold;">/</span>rsync.pwd</pre></td></tr></table></div>

<p>where [SERVER_IP] is rsync server IP</p>
<a rel="external nofollow" class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.fengcool.com%2F2009%2F07%2Frsync_server_and_client_backup_server_file%2F&amp;linkname=Rsync%20server%20and%20client%20%26%238211%3B%20backup%20your%20server%20files"><img src="http://www.fengcool.com/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Save/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.fengcool.com/2009/07/rsync_server_and_client_backup_server_file/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Plesk common shell commands</title>
		<link>http://www.fengcool.com/2009/06/plesk-common-shell-commands/</link>
		<comments>http://www.fengcool.com/2009/06/plesk-common-shell-commands/#comments</comments>
		<pubDate>Mon, 08 Jun 2009 18:02:40 +0000</pubDate>
		<dc:creator>Nelson</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Plesk]]></category>

		<guid isPermaLink="false">http://www.fengcool.com/?p=79</guid>
		<description><![CDATA[Plesk common shell commands]]></description>
			<content:encoded><![CDATA[<p>Reload vhost.conf for single domain</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="ini" style="font-family:monospace;">/usr/local/psa/admin/sbin/websrvmng --reconfigure-vhost --vhost-name<span style="color: #000066; font-weight:bold;">=</span></pre></td></tr></table></div>

<p>Update AWStats for only 1 domain in Plesk</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="ini" style="font-family:monospace;">/usr/local/psa/admin/sbin/statistics --calculate-one --domain-name<span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">you-domain.com</span></pre></td></tr></table></div>

<a rel="external nofollow" class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.fengcool.com%2F2009%2F06%2Fplesk-common-shell-commands%2F&amp;linkname=Plesk%20common%20shell%20commands"><img src="http://www.fengcool.com/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Save/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.fengcool.com/2009/06/plesk-common-shell-commands/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

