diff --git a/plugins/backup_ftp/class/ftp_client.py b/plugins/backup_ftp/class/ftp_client.py index c16e0981e..5d6c54007 100644 --- a/plugins/backup_ftp/class/ftp_client.py +++ b/plugins/backup_ftp/class/ftp_client.py @@ -187,7 +187,7 @@ class FtpPSClient: } mw.writeFile(pg_file, json.dumps(progress_info)) else: - progress_info = json.loads(public.readFile(pg_file)) + progress_info = json.loads(mw.readFile(pg_file)) if total_bytes == progress_info.get("total_bytes"): # 取远程文件大小 _max_loop = 10 @@ -352,7 +352,7 @@ class FtpPSClient: ftp.rmd(dir_name) return True except ftplib.error_perm as e: - print(str(e) + ":" + dir_name) + print("deleteDir:" + str(e) + ":" + dir_name) except Exception as e: print(e) return False diff --git a/plugins/backup_ftp/index.py b/plugins/backup_ftp/index.py index 5c8f2e299..bb7784a1b 100755 --- a/plugins/backup_ftp/index.py +++ b/plugins/backup_ftp/index.py @@ -192,10 +192,12 @@ def backupAllFunc(stype): prefix_dict[stype] + '_' + name find_new_file = "ls " + find_path + \ - "_* | grep tar.gz | cut -d \ -f 1 | awk 'END {print}'" + "_* | grep '.gz' | cut -d \ -f 1 | awk 'END {print}'" filename = mw.execShell(find_new_file)[0].strip() - # print("filename:", filename) + if filename == "": + print("not find upload file!") + return False ftp = FtpPSClient() ftp.uploadFile(filename, stype)