复制代码 代码如下: #!/usr/local/python import os import time import string source=[‘/var/www/html/xxx1/’,’/var/www/html/xxx2/’] target_dir=’/backup/’ target=target_dir+time.strftime(‘%Y%m%d’) zip_comm=’zip -r %s %s’%(target,” “.join(source)) target_database=[‘DB_name1′,’DB_name2’] sql_user=’root’ sql_pwd=’x