02 Feb 2016
yum install cifs-utils
mount -t cifs -o iocharset=utf8,username="desktop-opsuser",password="Sudoroot55",uid=0,dir_mode=0777,file_mode=0777,rw //172.16.2.28/dailybak /mnt/remote_bak/
参数:
需要确认的一点是,如果你希望以读写方式挂载,windows共享的目录属性中share和security都必须给与你mount命令中使用的用户读写权限,否则写入的时候会报错权限不足
cat << EOF > autobak.sh #!/bin/bash umount /mnt/remote_bak mount -t cifs -o iocharset=utf8,username=desktop-opsuser,password=Sudoroot88,uid=0,dir_mode=0777,file_mode=0777,rw //172.16.2.28/dailybak /mnt/remote_bak/ timestr=`date +%Y_%m_%d`_00\:00\:01.tar.gz desttimestr=`date +%Y%m%d`.tar.gz mv mc$timestr mc-$desttimestr 2>&1 mv mysql$timestr mysql-$desttimestr 2>&1 cp {mc-$desttimestr,mysql-$desttimestr} /mnt/remote_bak EOF
挂载时提示,mount error(12): Cannot allocate memory
window系统日志显示,服务器无法通过系统非页面共享区来进行分配,因为服务器已达非页面共享分配的配置极限。
找到注册表下列路径,HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanServer\Parameters\
创建或者修改DWORD类型的一个注册表IRPStackSize,值设定为十进制15以上,可以设置成18,然后重启windows系统即可