当前位置:服务支持 >  软件文章 >  教您实现sybase自动备份 定时任务配置教程

教您实现sybase自动备份 定时任务配置教程

阅读数 11
点赞 0
article_banner

sybase自动备份的方法我们经常会用到,下面就为您详细介绍sybase自动备份的实现过程,希望对您学习sybase自动备份方面能有所帮助。

Imports System.IO  
Module Module1  
 
Sub Main()  
 
Dim str_Path As String  
Dim str_FileName As String  
Dim str_Name As String  
Dim i As Integer, weeknum As Integer  
Dim f_file As System.IO.File  
Dim F_write As System.IO.StreamWriter  
Dim str_temp As String  
str_FileName = gbackupdump_data.txt  
If File.Exists(str_FileName) = True Then  
File.Delete(str_FileName)  
End If  
F_write = File.CreateText(str_FileName)  
F_write.WriteLine(use master)  
F_write.WriteLine(go)  
weeknum = Weekday(Now())  
'每隔一天转储的文件名相同  
Select Case weeknum  
Case 1, 2, 4, 6  
F_write.WriteLine(select getdate())  
F_write.WriteLine(go)  
F_write.WriteLine(dump database  bsjdw to 'g:\backup\dumpback\bsjdw_data0.dump')  
F_write.WriteLine(go)  
F_write.WriteLine(select getdate())  
F_write.WriteLine(go)  
F_write.WriteLine(dump database  system to 'g:\backup\dumpbacksystem_data0.dump')  
F_write.WriteLine(go)  
F_write.WriteLine(select getdate())  
F_write.WriteLine(go)  
Case 3, 5, 7  
F_write.WriteLine(select getdate())  
F_write.WriteLine(go)  
F_write.WriteLine(dump database  bsjdw to 'g:\backupdumpbackbsjdw_data1.dump')  
F_write.WriteLine(go)  
F_write.WriteLine(select getdate())  
F_write.WriteLine(go)  
F_write.WriteLine(dump database  system to 'gbackupdumpbacksystem_data1.dump')  
F_write.WriteLine(go)  
F_write.WriteLine(select getdate())  
F_write.WriteLine(go)  
 
End Select  
 
F_write.WriteLine(exit)  
F_write.Close()  
 
 
Dim ti As Date  
Dim te As Date  
ti = Now 
Dim logfilename As String  
logfilename = datafile + Trim(Str(Year(Now()))) + Trim(Str(Month(Now()))) + Trim(Str(Day(Now()))) + .txt  
Shell(cmd k isql -Usa -PSjb81! -i + str_FileName +gbackupdumpbackdumplog + logfilename, AppWinStyle.NormalFocus)  
 
te = Now 
Try  
Dim myProcesses() As Process  
Dim instance As Process  
Do  
myProcesses = Process.GetProcessesByName(cmd)  
Dim j As Integer  
j = 0 
For Each instance In myProcesses  
If instance.StartTime = ti And instance.StartTime = te Then  
j = 1 
End If  
Next  
If j = 0 Then  
Exit Do  
End If  
Loop  
myProcesses.Clear(myProcesses, 0, myProcesses.Length)  
Catch  
End Try  
 
Exit Sub  
End Sub  
 
End Module  
 
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
  • 41.
  • 42.
  • 43.
  • 44.
  • 45.
  • 46.
  • 47.
  • 48.
  • 49.
  • 50.
  • 51.
  • 52.
  • 53.
  • 54.
  • 55.
  • 56.
  • 57.
  • 58.
  • 59.
  • 60.
  • 61.
  • 62.
  • 63.
  • 64.
  • 65.
  • 66.
  • 67.
  • 68.
  • 69.
  • 70.
  • 71.
  • 72.
  • 73.
  • 74.
  • 75.
  • 76.
  • 77.
  • 78.
  • 79.
  • 80.
  • 81.
  • 82.
  • 83.
  • 84.

免责声明:本文系网络转载或改编,未找到原创作者,版权归原作者所有。如涉及版权,请联系删
相关文章
QR Code
微信扫一扫,欢迎咨询~

联系我们
武汉格发信息技术有限公司
湖北省武汉市经开区科技园西路6号103孵化器
电话:155-2731-8020 座机:027-59821821
邮件:tanzw@gofarlic.com
Copyright © 2023 Gofarsoft Co.,Ltd. 保留所有权利
遇到许可问题?该如何解决!?
评估许可证实际采购量? 
不清楚软件许可证使用数据? 
收到软件厂商律师函!?  
想要少购买点许可证,节省费用? 
收到软件厂商侵权通告!?  
有正版license,但许可证不够用,需要新购? 
联系方式 155-2731-8020
预留信息,一起解决您的问题
* 姓名:
* 手机:

* 公司名称:

姓名不为空

手机不正确

公司不为空