Read The Code!


#!/usr/bin/python
#coding=utf-8

import threading
import os
import time

#用户名
user = 'username'
#密码
passwd = 'password'
#备份保存路径
savepath = '/home/oracle/orcl_bak/'
#要备份的表
tables = ' tables=department,employee'
#备份周期
circle = 2.0

#备份命令
global bak_command

bak_command = 'exp '+user+'/'+passwd + ' file=' + savepath

def orclBak():
	now = time.strftime('%Y-%m-%d %H:%M:%S')
	command = bak_command + now + '.dmp' + tables
	print command
	if os.system(command) == 0:
		print '备份成功'
	else:
		print '备份失败'

	global t
	t = threading.Timer(circle, orclBak)
	t.start()

t = threading.Timer(circle, orclBak)
t.start()

  

相关文章:

  • 2021-09-29
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-26
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-04-19
  • 2022-01-17
  • 2021-12-19
  • 2021-10-30
  • 2022-01-05
相关资源
相似解决方案