📄 1551.html
字号:
name=header_r1_c1></A></TD>
<TD colSpan=3>
<form action="http://www.linuxhero.com/docs/search.html" method=get>
<table
style="BORDER-RIGHT: #c4c4c4 1px solid; BORDER-TOP: #c4c4c4 1px solid; BORDER-LEFT: #c4c4c4 1px solid; BORDER-BOTTOM: #c4c4c4 1px solid"
cellspacing=0 cellpadding=3 width="95%" border=0 align="center">
<tbody>
<tr>
<td noWrap background="images/bgline.gif" tppabs="http://www.linuxhero.com/docs/images/bgline.gif">
<div align=center><font class=normalfont>搜索文章:
<input type=hidden value=result name=action2>
<input type=radio checked value=title name=type>标题
<input type=radio value=content name=type>内容
<input type=image src="images/button_go.gif" tppabs="http://www.linuxhero.com/docs/images/button_go.gif" border=0 name=image2>
</font></div>
</td>
</tr>
<tr>
<td noWrap>
<div align="center">
<input maxlength=100 size=30 name=keyword2>
</div>
</td>
</tr></tbody>
</table>
</form>
</TD>
<TD rowSpan=2><IMG src="images/header_r1_c7.gif" tppabs="http://www.linuxhero.com/docs/images/header_r1_c7.gif" width=26 border=0 name=header_r1_c7></TD>
<TD><IMG height=83 src="images/spacer.gif" tppabs="http://www.linuxhero.com/docs/images/spacer.gif" width=1 border=0></TD></TR>
<TR>
<TD background="images/bgline.gif" tppabs="http://www.linuxhero.com/docs/images/bgline.gif"><IMG height=22
src="images/header_r2_c1.gif" tppabs="http://www.linuxhero.com/docs/images/header_r2_c1.gif" width=296 border=0
name=header_r2_c1></TD>
<TD background="images/bgline.gif" tppabs="http://www.linuxhero.com/docs/images/bgline.gif" colSpan=5>
<DIV align=right><FONT class=normalfont>当前位置:
<A href="index.html" tppabs="http://www.linuxhero.com/docs/index.html">本站首页</A>
<font color="#FF6699">>></font>
<A href="type23.html" tppabs="http://www.linuxhero.com/docs/type23.html">samba</A> | <A href="copyright.html" tppabs="http://www.linuxhero.com/docs/copyright.html">版权说明</A></font></DIV>
</TD>
<TD><IMG height=22 src="images/spacer.gif" tppabs="http://www.linuxhero.com/docs/images/spacer.gif" width=1
border=0></TD></TR></TBODY></TABLE>
<TABLE cellSpacing=10 cellPadding=0 width="100%" bgColor=#ffffff
border=0>
<TR>
<TD>
<TABLE cellSpacing=0 cellPadding=3 width="100%" border=0>
<TR>
<TD vAlign=top align=middle width="60%">
<TABLE cellSpacing=0 cellPadding=0 width="100%"
background="images/back.gif" tppabs="http://www.linuxhero.com/docs/images/back.gif" border=0>
<TBODY>
<TR>
<TD vAlign=top width="80%">
<DIV align=center>
<FORM action="search.html" tppabs="http://www.linuxhero.com/docs/search.html" method=get>
</FORM>
<TABLE cellSpacing=0 cellPadding=0 width="95%"
border=0><TBODY>
<TR>
<TD background="images/bgi.gif" tppabs="http://www.linuxhero.com/docs/images/bgi.gif"
height=30></TD></TR></TBODY></TABLE>
<TABLE cellSpacing=0 cellPadding=3 width="95%"
align=center border=0>
<TBODY>
<TR>
<TD>
<TABLE cellSpacing=0 cellPadding=3 width="100%"
border=0>
<TBODY>
<TR>
<TD vAlign=top>
<p><FONT class=normalfont><B><font color=blue>SMB的扩展应用</font></B></FONT><BR><FONT class=smallfont color=#ff9900>2004-04-23 15:18 pm</FONT><BR><FONT class=normalfont>作者:作者<br>来自:Linux知识宝库<br>联系方式:无名<br><br> 在Linux风行的今天,与Windows机器相互共享文件已经是非常普遍的应用了,关于samba的设置的文档也相当的多,本站也有不少了。不过在使用它的高级功能方面还是比较欠缺的,这类文档是非常稀有的,而且只有英文版的,为了方便国内的Linux用户,我将这些文档整理一下,翻译过来,并结合自己一些经验,为大家提供一些帮助。<br>
注:这篇文章并不是一篇关于如何配置samba的基础文档,而是需要阅读者有一定的Linux使用经验,熟悉脚本语言,并且对samba有一定的使用经验。主要是针对于一些企业的Linux网管,或比较有经验的Linux爱好者。<br>
这篇文章也其说是文章,不如说是一个技巧提示,但是我个人觉得它意义非常大,特别是对于大中型企业的用户来讲,它可能非常重要。<br>
它主要描述了如果在Linux下使用samba来为使用Windows系统的机器作备份,并且描述了如何跨子网共享samba。<br>
1、将Windows机器备分到一台Linux主机上<br>
Adam Neat(adamneat@ipax.com.au),向我们提供了以下一段代码,它描述了如何使用smbclient软件包将windows机器备份到Linux主机上。Adam说它可以用来备份windows 3.x和NT机器到一台Linux的磁带机上。<br>
另一段代码,是Dan Tager (dtager@marsala.com),提供的,Dan的脚本是通过rsh来备份Unix机器,尽管它可以修改成ssh以便使其更简单些。<br>
在下面这个脚本中,字符串“agnea1”是作备份工作的Linux主机的一个用户名。<br>
#!/bin/bash
clear
echo Initialising ...
checkdate=`date | awk '{print $1}'`<br>
if [ -f "~agnea1/backup-dir/backup-data" ]; then
echo "ERROR: No config file for today!"
echo "FATAL!"
exit 1
fi<br>
if [ -d "~agnea1/backup-dir/temp" ]; then
echo "ERROR: No tempoary directory found!"
echo
echo "Attempting to create"
cd ~agnea1
cd backup-dir
mkdir temp
echo "Directory Made - temp"
fi<br>
if [ "$1" = "" ]; then
echo "ERROR: enter in a machine name (ie: cdwriter)"
exit 1
fi<br>
if [ "$2" = "" ]; then
echo "ERROR: enter in a SMB (Lan Manager) Resource (ie: work)"
exit 1
fi<br>
if [ "$3" = "" ]; then
echo "ERROR: enter in an IP address for $1 (ie:
130.xxx.xxx.52)" exit 1
fi
#########################################################
# Main Section
#
#########################################################<br>
cd ~agnea1/backup-dir/temp
rm -r ~agnea1/backup-dir/temp/*
cd ~agnea1/backup-dir/<br>
case "$checkdate"
in
Mon)
echo "Backuping for Monday"
cat backup-data | /usr/local/samba/bin/smbclient
$1$2 -I$3 -N echo "Complete"
if [ -d "~agnea1/backup-dir/Monday" ]; then
echo "Directory Monday Not found ...
making" mkdir
~agnea1/backup-dir/Monday
fi<br>
echo "Archiving ..."
cd ~agnea1/backup-dir/temp
tar -cf monday.tar *echo "done ..."
rm ~agnea1/backup-dir/Monday/monday.tar
mv monday.tar ~agnea1/backup-dir/Monday
;;<br>
Tue)
echo "Backuping for Tuesday"
cat backup-data | /usr/local/samba/bin/smbclient
$1$2 -I$3 -N echo "Complete"<br>
if [ -d "~agnea1/backup-dir/Tuesday" ]; then
echo "Directory Tuesday Not found ...
making" mkdir
~agnea1/backup-dir/Tuesday
fi
echo "Archiving ..."
cd ~agnea1/backup-dir/temp
tar -cf tuesday.tar *
echo "done ..."
rm ~agnea1/backup-dir/Tuesday/tuesday.tar
mv tuesday.tar ~agnea1/backup-dir/Tuesday
;;<br>
Wed)
echo "Backuping for Wednesday"
cat backup-data | /usr/local/samba/bin/smbclient
$1$2 -I$3 -N echo "Complete"<br>
if [ -d "~agnea1/backup-dir/Wednesday" ]; then
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -