十年網(wǎng)站開(kāi)發(fā)經(jīng)驗(yàn) + 多家企業(yè)客戶 + 靠譜的建站團(tuán)隊(duì)
量身定制 + 運(yùn)營(yíng)維護(hù)+專(zhuān)業(yè)推廣+無(wú)憂售后,網(wǎng)站問(wèn)題一站解決
一個(gè)自動(dòng)生成升級(jí)文件列表的腳本,可以運(yùn)行在WIN或者linux
為企業(yè)提供網(wǎng)站設(shè)計(jì)制作、網(wǎng)站設(shè)計(jì)、網(wǎng)站優(yōu)化、全網(wǎng)營(yíng)銷(xiāo)推廣、競(jìng)價(jià)托管、品牌運(yùn)營(yíng)等營(yíng)銷(xiāo)獲客服務(wù)。成都創(chuàng)新互聯(lián)公司擁有網(wǎng)絡(luò)營(yíng)銷(xiāo)運(yùn)營(yíng)團(tuán)隊(duì),以豐富的互聯(lián)網(wǎng)營(yíng)銷(xiāo)經(jīng)驗(yàn)助力企業(yè)精準(zhǔn)獲客,真正落地解決中小企業(yè)營(yíng)銷(xiāo)獲客難題,做到“讓獲客更簡(jiǎn)單”。自創(chuàng)立至今,成功用技術(shù)實(shí)力解決了企業(yè)“網(wǎng)站建設(shè)、網(wǎng)絡(luò)品牌塑造、網(wǎng)絡(luò)營(yíng)銷(xiāo)”三大難題,同時(shí)降低了營(yíng)銷(xiāo)成本,提高了有效客戶轉(zhuǎn)化率,獲得了眾多企業(yè)客戶的高度認(rèn)可!
要判斷中間的版本號(hào),取最大的
文件最終樣式如下
productname:ABCikn7
version:2.23.81
uname:ABCikn7_2.23.81_20120101.upt
usize:3598290
dname:ABCikn7_2.23.81_20120101.dd5
dsize:33
url1:ftp://ftp.163.com/down/
productname:xx001A
version:4.0.4
uname:xx001A_4.0.4_20131114.upt
usize:14008320
dname:xx001A_4.0.4_20131114.dd5
dsize:40
url1:ftp://ftp.163.com/down/
url2:ftp://ftp.265.com/down/
#!/usr/bin/ruby require 'net/ftp' ip = ["1.2.3.4","2.11.12.2"] #server IP add url = ["url1:ftp://ftp.163.com/down/","url2:ftp://ftp.265.com/down/"] update_file = ["e:\\update.txt", "/tmp/update.dat"] #Win or Linux file_hash = {} text = '' def os_family case RUBY_PLATFORM when /ix/i, /ux/i, /gnu/i, /sysv/i, /solaris/i, /sunos/i, /bsd/i "unix" when /win/i, /ming/i "windows" else "other" end end if os_family == "unix" text_file = update_file[1] elsif os_family == "windows" text_file = update_file[0] else puts "unkown os" Process.exit(1) end def file_list(ip) #get ftp dir list files = [] ip.size.times{|x| ftp = Net::FTP.open(ip[x]) ftp.login('username','password') ftp.passive = true files << ftp.list('down') ftp.close } return files end def key_values(type,n,name_size) #get type_x.x.x_date.upt dd, up = '', '' if n == 1 regexp = "#{type}_\\d+\\.\\d+\\.\\d+_\\d+." else regexp = "#{type}_\\d+\\." end 2.times { name_size.each_key { |m| if /#{regexp}dd5/.match(m) dd = m.to_s elsif /#{regexp}upt/.match(m) up = m.to_s end } } return dd, name_size[dd], up, name_size[up] end def formatstr(dd,dd_size,up,up_size) type, ver = '', '' tmp = [] tmp = dd.split('_') type = tmp[0] ver = tmp[1] msg =<
網(wǎng)頁(yè)標(biāo)題:升級(jí)列表自動(dòng)生成腳本
網(wǎng)頁(yè)URL:http://m.jiaotiyi.com/article/jjdioi.html