寻觅生命中的那一片浅草......

rsync_error_deflate

Today I check synchronization status of my backup files.There is three files are not synchronizing.I type the rsync command manually to see what happend.

rsync -vazu –password-file=/etc/my.pass rsy@192.168.1.130::db_backup /data/backup/

it shows these errors:

deflate on token returned 0 (12912 bytes left)
rsync error: error in rsync protocol data stream (code 12) at token.c(274)
rsync: connection unexpectedly closed (347 bytes received so far) [receiver]
rsync error: error in rsync protocol data stream (code 12) at io.c(463) [receiver=2.6.8]
rsync: connection unexpectedly closed (327 bytes received so far) [generator]
rsync error: error in rsync protocol data stream (code 12) at io.c(463) [generator=2.6.8]

After some googles,I find that There is something wrong with the last file in local directory.
Then I delete the last file in local directory and run the rsync command again.It works.All files are synchronizing.

References:
http://www.linuxsir.org/bbs/showthread.php?t=201042

2010-09-14
I can’t believe that the problem happens again.There is two files are not synchronizing.
I search this error “deflate on token returned” in google.I find this URL.
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=50248
It’s very helpful.According to this article,that guy also get “deflate on token returned” error when he use “rsync -z” to deal with a 2GB big file
All my files are nearly 7GB.Maybe the “-z” option make rsync crash.
When I run “rsync -vau –password-file=/etc/my.pass rsy@192.168.1.130::db_backup /data/backup/”,it works.
At last, I remove -z from my rsync scripts.

Bypass a fsck during boot

Today,I reboot my CentOS box,It show some errors:

An error occurred during the file system check.
Dropping you to a shell;the system will reboot
when you leave the shell.
Give root password for maintenance
(or type Control-D to continue):

I know what cause this:Yesterday, I remove one partition, but I didn’t remove it from /etc/fstab

I don’t know the root’s password.so what only I can do is clicking Ctl+D,then the system reboot.

During the boot procedure,I edit the grub boot menu, add “single” at the end of kernel line.
After editing, it look likes ” kernel /vmlinuz-2.6.18-92.1.22.el5 ro root=LABEL=/ single”

I think the system will boot into single user mode.But unfortunately,it show the same errors.

I google with “boot ignore system check”,and I find an useful article.It shows that we can
put fastboot at the end of the kernel line.

In the end it should look as follow:
kernel /vmlinuz-2.6.18-92.1.22.el5 ro root=LABEL=/ fastboot

Greate!It works.

I ssh to the server and remove the old partition from /etc/fstab

OK,the article’s URL is http://www.cyberciti.biz/faq/linux-unix-bypassing-fsck/

http://www.cyberciti.biz/ is a great website,it contains many tips on linux,also it contains many shell scripts makes your system administration work easy.You must add it to your Favorite。

MySQL:how to ignore errors loading a dump

When we load a dump sql file using the following command:
mysql -uroot -pdbpassword test < /data/mysql.sql
the procedure will stop as it detects an error.
How to make procedure ignore the errors and continue anyway?
There are two kinds of methond can do that.

The first one:use “-f” option
mysql -uroot -pdbpassword -f test < /data/mysql.sql

The second one:access into mysql,and use the “source” command.
mysql -uroot -pdbpassword test
source /data/mysql.sql
exit

References:

http://forums.mysql.com/read.php?28,78316,78316

Using Ketchup to manage your kernel sources

Today I discovered Ketchup, a little command-line tool to manage your Linux kernel sources. If you’re one of the weirdos, who is still compiling his kernel manually for whatever reason (like I do), I can only recommend it. Ketchup nicely eases up the entire process of checking for updates and applying them to your system.

Let’s not hesitate and look at few usage examples… Want to know what’s the latest version of a particular kernel-tree?

$ ketchup -s 2.6

2.6.17.7

$ ketchup -s 2.6-mm

2.6.18-rc1-mm2

Let’s play with your kernel sources a bit. First of all, you surely want to check what version you currently got lying around…

$ cd /usr/src/linux

$ ketchup -m

2.6.17.6

Let’s assume there is a newer kernel version available and you want to download it, bunzip it, revert the old patch and apply the new one. Nothing easier than that:

# cd /usr/src/linux

# ketchup 2.6-tip

2.6.17.6 -> 2.6.17.7

Applying patch-2.6.17.6.bz2 -R

Applying patch-2.6.17.7.bz2

That’s really it. It will download the patches, revert and apply them, so all you will have to do is watch and wait

Switching to an entirely different kernel versions is just as easy:

# cd /usr/src/linux

# ketchup 2.6.16.2

Final note: If Ketchup should abort with a gpg error, then it couldn’t verify the patch’s or kernel’s signature. Either add the 2.6 public key to your keyring (this is the proper solution) or call Ketchup with an additional -G parameter (this will override signature checking). I’d suggest the former, which is really easy to do by downloading it from a public pgp server:

# gpg –keyserver wwwkeys.pgp.net –recv-keys 0x517D0F0E

Have fun compiling,

muesli

From:http://amarok.kde.org/blog/archives/199-Using-Ketchup-to-manage-your-kernel-sources.html

域名解析检查工具

由于都是双线机房,所以域名解析要检查是否正确解析了电信IP,网通IP

同时还要检查IP是否可以ping通,为方便操作,写了个bat

代码如下:

@echo off
cls
color 1f
Title 检查域名解析
echo.
echo. 域名解析检查工具
echo. johncan
echo. 2010-07-27
echo.
echo.
echo ——————————————————————————-
echo.
set /p domain= 请输入要检查的域名:
echo.
for /f “delims=: tokens=1,2” %%i in (‘nslookup “%domain%”‘) do (
if /I “%%i”==”Address” (set “result=%%j”)
)
for /f “delims=: tokens=1,2” %%i in (‘nslookup “%domain%” 210.51.176.71’) do (
if /I “%%i”==”Address” (set “cnc_result=%%j”)
)

echo 域名: %domain%
echo 电信IP:%result%
echo 网通IP:%cnc_result%

echo.
echo.

echo ########## Ping %result% Result ##########
ping -n 10 %result%

echo.
echo.
echo ########## Ping %cnc_result% Result ##########
ping -n 10 %cnc_result%

echo.
echo.

echo 按任意键退出
pause >nul

2025年七月
« 5月    
 123456
78910111213
14151617181920
21222324252627
28293031