2011. 7. 7. 12:32
카테고리 없음
import os
import sys
import string
import time
import glob
from ftplib import FTP
ftphost = 'xxx.xxx.xxx.xxx'
ftpuid = 'backup'
ftppwd = 'backup'
ftp = FTP(ftphost)
ftp.login(ftpuid,ftppwd)
ftp.cwd('db/mssql2000/')
files = glob.glob('D:\database\data\mssql\BACKUP\*')
for file in files:
filenames = string.split(file,'\\')
filename = filenames[-1] #get filename
if os.path.isfile(file):
print "Put:",file
ftp.storbinary("STOR "+filename,open(file,'rb'),1024)
time.sleep(2)
ftp.quit()
import sys
import string
import time
import glob
from ftplib import FTP
ftphost = 'xxx.xxx.xxx.xxx'
ftpuid = 'backup'
ftppwd = 'backup'
ftp = FTP(ftphost)
ftp.login(ftpuid,ftppwd)
ftp.cwd('db/mssql2000/')
files = glob.glob('D:\database\data\mssql\BACKUP\*')
for file in files:
filenames = string.split(file,'\\')
filename = filenames[-1] #get filename
if os.path.isfile(file):
print "Put:",file
ftp.storbinary("STOR "+filename,open(file,'rb'),1024)
time.sleep(2)
ftp.quit()