Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2914880
  • 博文数量: 454
  • 博客积分: 4860
  • 博客等级: 上校
  • 技术积分: 6375
  • 用 户 组: 普通用户
  • 注册时间: 2011-03-13 10:08
个人简介

10年工作经验,专研网站运维。

文章分类

全部博文(454)

文章存档

2017年(11)

2016年(13)

2015年(47)

2014年(36)

2013年(147)

2012年(64)

2011年(136)

分类: LINUX

2011-05-11 14:40:39

1、两个文件不传:
/www/cmstest/my120/public/scripts/js/video/webConfig.xml
说明:修改ip地址(10处)
/www/cmstest/my120/application/configs/application.ini
修改数据库密码:为hrsx903
D:\工作文件\development\my120\library\Zend  文件不传
.svn文件不传。

2、过滤上传文件:
点击:  查看--过滤器--选中( 启动过滤、将过滤应用到文件夹名、应用到文件传输 )。
选择忽略过滤通配符,添加你想要过滤的文件,或文件的一部分。确定即可。

3、文件超级权限:
chmod -R 777 /www/cmstest/my120/public/scripts/jpgraph

4、视频质量配置文件:
/www/cmstest/my120/public/scripts/js/video/webConfig.xml

团队利用SVN进行版本管理,但是将经过了本地测试的文件上传至服务器仍然需要使用FTP,需要由相关人员提供要上传的文件,使用CuteFTP上传至服务器。手工上传是件很机械的工作,耗时、枯燥、易出错,而且效率低下,占用了负责上传的人员的大量宝贵时间。

CuteFTP可以编写脚本完成自动上传,解放了上传人员,提高了效率,减少了漏传和误传的机会。
实现的步骤如下:

1、在桌面新建一个脚本文件 test.vbs

内容如下:


   Dim objArgs, MySite, theFile, Fso, Line

   Set   objArgs   =   WScript.Arguments 

   'Create a connection object and assign it to the variable

   Set MySite = CreateObject("CuteFTPPro.TEConnection")
  
   ' Now set each property for the site connection
   ' You can omit this section to use the default values, but you should at least specify the Host
   'The default Protocol is FTP, however SFTP (SSH2), FTPS (SSL), HTTP, and HTTPS can also be used)

   MySite.Protocol = "FTP"
   MySite.Host = "192.168.0.244"

   'following lines are optional since the default is anonymous if no login and password are defined

   MySite.Login = "dahai"
   MySite.Password = "dahai"

   'if necessary, use the UseProxy method and ProxyInfo or SocksInfo properties to connect through a proxy server

   MySite.UseProxy = "BOTH"

   'now connect to the site (also called called implicitly when most remote methods are called)

   MySite.Connect

  
   'perform some logic to verify that the connection was made successfully

   If (Not Cbool(MySite.IsConnected)) Then  
      MsgBox "Could not connect to: " & MySite.Host & "!"
      Quit(1)
   End If

   'InputBox "please input file name"
   uploadFile = InputBox("请输入文件名")

   'upload special files and folders in provied files.
         Set Fso = CreateObject("Scripting.FileSystemObject")
         Set theFile = fso.OpenTextFile("D:\\cftp\\" & uploadFile, 1, False)

//需要上传的路径的文件,文件名叫1.txt,在这个文件中填入上传的路径,上传的时候有这个文件就覆盖,没有就上传。
         Do While theFile.AtEndOfStream <> True
            fileName = theFile.ReadLine
            localPath = "D:\工作文件\development\" & fileName

////就在这个路径下,要传my120文件夹,就指到这个目录下就行了,不要指到my120目录,就是指向要传的目录的上一级目录即可。。。。。这个目录是要上传的目录
            remotePath = filename
            MySite.UploadAsync  localPath, remotePath
         Loop
         theFile.Close

   'Complete.  Show the status of this transfer.
   MsgBox "Task done, final status is '" + MySite.Status + "'"

  MySite.Disconnect
  MySite.Close

'End of sample script. You can save you script and then run it by either selecting it from the Tools > Run Script menu or by double clicking on the script file in Windows

保存退出:

绿色部分需要删除,蓝色部分需要修改。

在d盘新建文件夹cftp,再新建一个文件 1.txt,在文件里填入路径,这个路径是D:\工作文件\development\这个文件夹下的相对路径,而且是这个文件夹下有的路径,没有就上传不了,说回来,就是将这个路径下的文件上传到服务器上,服务器根据路径自动匹配。举例:my120/application/Bootstrap.php

阅读(1332) | 评论(0) | 转发(0) |
0

上一篇:cacti 配置

下一篇:apache 优化

给主人留下些什么吧!~~