KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Im trying to download daily a backup file from my server to my local storage server, but i got some problems. I wrote this code (removed the useless parts, as the email function): import os from time import strftime from ftplib import FTP import smtplib from email.MIMEMultipart import MIMEMultipart from email.MIMEBase import MIMEBase from email.MIMEText import MIMEText from email import Encoders day = strftime("%d") today = strftime("%d-%m-%Y") link = FTP(ftphost) link.login(passwd = ftp_pass, user = ftp_user) link.cwd(file_path) link.retrbinary('RETR ' + file_name, open('/var/backups/backup-%s.tgz' % today, 'wb').write) link.delete(file_name) #delete the file from online server link.close() mail(user_mail, "Download database %s" % today, "Database sucessfully downloaded: %s" % file_name) exit() And i run this with a crontab like: 40 23 * * * python /usr/bin/backup-transfer.py >> /var/log/backup-transfer.log 2>&1 It works with small files, but with the backups files (about 1.7Gb) it freeze, the downloaded file get about 1.2Gb then never grows up (i waited about a day), and the log file is empty. Any idea? p.s: im using Python 2.6.5
Tags (comma-separated)
Save Edits
Cancel