new Release
This commit is contained in:
parent
1cefb988a0
commit
499cd1487b
10
README.md
10
README.md
@ -3,12 +3,12 @@
|
|||||||
|
|
||||||
## Short description
|
## Short description
|
||||||
|
|
||||||
Drive snapshot backup controller.
|
Drive Snapshot backup controller.
|
||||||
A backup wrapper program for Windows boxes.
|
A backup wrapper program for Windows boxes.
|
||||||
|
|
||||||
Features:
|
Features:
|
||||||
- Starts a backup via Windows Scheduler using Drive Snapshot by Tom Ehlert
|
- Starts a backup via Windows Scheduler using Drive Snapshot by Tom Ehlert
|
||||||
- Asks the user for permission to start backup
|
- Can ask the user for permission to start a backup
|
||||||
- Can do a shutdown after backup
|
- Can do a shutdown after backup
|
||||||
- Different backup targets (local DRIVE, SMB, FTP)
|
- Different backup targets (local DRIVE, SMB, FTP)
|
||||||
- Encryption support (via Drive Snapshot)
|
- Encryption support (via Drive Snapshot)
|
||||||
@ -16,7 +16,7 @@ Features:
|
|||||||
- New full backup every month
|
- New full backup every month
|
||||||
- Daily differential backup
|
- Daily differential backup
|
||||||
- Writes detailed logfile and history log
|
- Writes detailed logfile and history log
|
||||||
- Sends reports via email
|
- Sends reports via email (using cmail.exe)
|
||||||
|
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
@ -28,6 +28,9 @@ Download here: [snapshot.exe](http://www.drivesnapshot.de/download/snapshot.exe)
|
|||||||
|
|
||||||
You can test Drive snapshot for a limited time. Please support this great tool and consider to buy a license.
|
You can test Drive snapshot for a limited time. Please support this great tool and consider to buy a license.
|
||||||
|
|
||||||
|
You will also need [CMail](https://www.inveigle.net/cmail) for sending emails.
|
||||||
|
Get it from here: https://www.inveigle.net/cmail/download
|
||||||
|
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
@ -63,3 +66,4 @@ usage: snapcontrol.exe </I | /U | /D | /V>
|
|||||||
```
|
```
|
||||||
|
|
||||||
Everytime you change the values in "BackupSched" or "BackupStart" you will have to call snapcontrol.exe with the /U switch.
|
Everytime you change the values in "BackupSched" or "BackupStart" you will have to call snapcontrol.exe with the /U switch.
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
; where to install the exe and the infile ...
|
; where to install the exe and the infile ...
|
||||||
InstallTo = c:\snapshot
|
InstallTo = c:\snapshot
|
||||||
|
|
||||||
; path where snapshot.exe is located ...
|
; path where snapshot.exe and cmail.exe is located ...
|
||||||
BinPath = c:\tools
|
BinPath = c:\tools
|
||||||
|
|
||||||
|
|
||||||
@ -29,7 +29,7 @@ BinPath = c:\tools
|
|||||||
; - "/backup" (some path on FTP server)
|
; - "/backup" (some path on FTP server)
|
||||||
TargetPath = D:\BACKUP
|
TargetPath = D:\BACKUP
|
||||||
|
|
||||||
; active FTP backup with "yes"
|
; activate FTP backup with "yes"
|
||||||
FtpBackup = no
|
FtpBackup = no
|
||||||
|
|
||||||
; name of ftp server
|
; name of ftp server
|
||||||
@ -94,23 +94,30 @@ HistLog = history.log
|
|||||||
|
|
||||||
[MAIL]
|
[MAIL]
|
||||||
;
|
;
|
||||||
; The mail setup in this config file was tested and works perfectly
|
; We use "CMail" here because the builtin mail funtions (PureBasic)
|
||||||
; for gmail (please be aware that you will have to change your
|
; are having problems with modern starttls(ssl/tls) communication
|
||||||
; gmail security settings in case you plan to use gmail)
|
|
||||||
;
|
;
|
||||||
|
|
||||||
; shall we send a mail ?
|
; shall we send a mail ?
|
||||||
MailReport = no
|
MailReport = no
|
||||||
|
|
||||||
|
; maildebugging ? (yes/no)
|
||||||
|
MailDebug = no
|
||||||
|
|
||||||
|
; mail sender...
|
||||||
|
; address formt can be:
|
||||||
|
; john.doe@domain.com
|
||||||
|
; or "<john.doe@domain.com>"
|
||||||
|
; or "john doe <john.doe@domain.com>"
|
||||||
|
; HINT: some mail providers do not accept fictional sender addresses!
|
||||||
|
MailFrom = "MyBackup <john.doe@domain.com>"
|
||||||
|
|
||||||
; mail recipient...
|
; mail recipient...
|
||||||
MailTo = backup@example.com
|
MailTo = backup@example.com
|
||||||
|
|
||||||
; address of SMTP server (TLS/SSL only !)
|
; address of SMTP server (TLS/SSL only !)
|
||||||
MailServer = smtp.gmail.com
|
MailServer = smtp.gmail.com
|
||||||
|
|
||||||
; port of SMTP server (in most cases it's 465 or 587)
|
|
||||||
MailPort = 465
|
|
||||||
|
|
||||||
; user for sending mail
|
; user for sending mail
|
||||||
MailUser = example@gmail.com
|
MailUser = example@gmail.com
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
; LICENSE : MIT License
|
; LICENSE : MIT License
|
||||||
; AUTHOR : Michael H.G. Schmidt
|
; AUTHOR : Michael H.G. Schmidt
|
||||||
; EMAIL : michael@schmidt2.de
|
; EMAIL : michael@schmidt2.de
|
||||||
; DATE : 20210530
|
; DATE : 20211003
|
||||||
; ------------------------------------------------------------
|
; ------------------------------------------------------------
|
||||||
;
|
;
|
||||||
; This tool creates an image backups of windows machines,
|
; This tool creates an image backups of windows machines,
|
||||||
@ -29,7 +29,7 @@ EnableGraphicalConsole(0)
|
|||||||
|
|
||||||
Dim filelist$(0)
|
Dim filelist$(0)
|
||||||
|
|
||||||
Global VERSION$="V1.05"
|
Global VERSION$="V1.06"
|
||||||
Global installme = 0
|
Global installme = 0
|
||||||
Global updatesched = 0
|
Global updatesched = 0
|
||||||
Global dryrun = 0
|
Global dryrun = 0
|
||||||
@ -127,9 +127,10 @@ HistLog$ = InstallTo$ + "\" + HistLog$
|
|||||||
|
|
||||||
PreferenceGroup("mail")
|
PreferenceGroup("mail")
|
||||||
Global MailReport$ = Trim(LCase(ReadPreferenceString("MailReport","no")))
|
Global MailReport$ = Trim(LCase(ReadPreferenceString("MailReport","no")))
|
||||||
|
Global MailDebug$ = Trim(ReadPreferenceString("MailDebug","no"))
|
||||||
|
Global MailFrom$ = Trim(ReadPreferenceString("MailFrom",""))
|
||||||
Global MailTo$ = Trim(ReadPreferenceString("MailTo",""))
|
Global MailTo$ = Trim(ReadPreferenceString("MailTo",""))
|
||||||
Global MailServer$ = Trim(ReadPreferenceString("MailServer",""))
|
Global MailServer$ = Trim(ReadPreferenceString("MailServer",""))
|
||||||
Global MailPort = Val(Trim(ReadPreferenceString("MailPort","")))
|
|
||||||
Global MailUser$ = Trim(ReadPreferenceString("MailUser",""))
|
Global MailUser$ = Trim(ReadPreferenceString("MailUser",""))
|
||||||
Global MailPass$ = Trim(ReadPreferenceString("MailPass",""))
|
Global MailPass$ = Trim(ReadPreferenceString("MailPass",""))
|
||||||
|
|
||||||
@ -204,30 +205,41 @@ Procedure IsAdmin()
|
|||||||
ProcedureReturn(system("reg.exe ADD HKLM /F >nul 2>&1"))
|
ProcedureReturn(system("reg.exe ADD HKLM /F >nul 2>&1"))
|
||||||
EndProcedure
|
EndProcedure
|
||||||
|
|
||||||
Procedure LogSend(subject$, filename$)
|
Procedure LogSend(subject$)
|
||||||
InitNetwork()
|
Protected MailCommand$ = BinPath$ + "\cmail.exe"
|
||||||
Protected e = 0
|
|
||||||
Protected MailText$ = ""
|
; CMail found ?
|
||||||
|
If ( FileSize ( MailCommand$ ) < 0 )
|
||||||
If CreateMail(0, "system@" + hostname$ , subject$)
|
LogMe("ERROR: [ " + MailCommand$ + " ] NOT found.")
|
||||||
AddMailRecipient(0, MailTo$, #PB_Mail_To)
|
ProcedureReturn false
|
||||||
LogMe("INFO: MailServer = " + Mailserver$)
|
|
||||||
If ReadFile(0, filename$, #PB_File_SharedRead)
|
|
||||||
While Eof(0) = 0
|
|
||||||
MailText$ + ReadString(0) + Chr($0d) + Chr($0a)
|
|
||||||
Wend
|
|
||||||
CloseFile(0)
|
|
||||||
SetMailBody(0, MailText$)
|
|
||||||
EndIf
|
|
||||||
|
|
||||||
; send mails ALWAYS with SSL...
|
|
||||||
e = SendMail(0, MailServer$, MailPort, #PB_Mail_UseSSL, MailUser$, MailPass$)
|
|
||||||
EndIf
|
EndIf
|
||||||
|
|
||||||
ProcedureReturn e
|
; use debug mode ?
|
||||||
|
If (MailDebug$ = "yes" )
|
||||||
|
MailCommand$ + " -d"
|
||||||
|
EndIf
|
||||||
|
|
||||||
|
; send mails ALWAYS with STARTTLS...
|
||||||
|
MailCommand$ + " -starttls -host"
|
||||||
|
MailCommand$ + ":" + MailUser$
|
||||||
|
MailCommand$ + ":" + Chr(34) + MailPass$ + Chr(34)
|
||||||
|
MailCommand$ + "@" + MailServer$
|
||||||
|
MailCommand$ + " -from:" + MailFrom$
|
||||||
|
MailCommand$ + " -to:" + MailTo$
|
||||||
|
MailCommand$ + " -subject:" + Chr(34) + subject$ + Chr(34)
|
||||||
|
MailCommand$ + " -body-file:" + LogFile$
|
||||||
|
|
||||||
|
; show full command in debug mode ...
|
||||||
|
If (MailDebug$ = "yes" )
|
||||||
|
Print(MailCommand$ + Chr($0d) + Chr($0a))
|
||||||
|
EndIf
|
||||||
|
|
||||||
|
dummy=system(MailCommand$)
|
||||||
|
ProcedureReturn true
|
||||||
|
|
||||||
EndProcedure
|
EndProcedure
|
||||||
|
|
||||||
Procedure EndProg(err)
|
Procedure EndProg(err)
|
||||||
Protected s$ = ""
|
Protected s$ = ""
|
||||||
|
|
||||||
If ( err = 0 )
|
If ( err = 0 )
|
||||||
@ -236,22 +248,22 @@ Procedure EndProg(err)
|
|||||||
Else
|
Else
|
||||||
LogMe("ERROR: END of BACKUP with result FAILED !")
|
LogMe("ERROR: END of BACKUP with result FAILED !")
|
||||||
s$ = "BACKUP report - { ERROR ! } @" + hostname$
|
s$ = "BACKUP report - { ERROR ! } @" + hostname$
|
||||||
EndIf
|
|
||||||
|
|
||||||
; write return code of last command (snapshot.exe) to logfile
|
EndIf
|
||||||
LogMe("return=" + err)
|
|
||||||
|
|
||||||
; send a report via mail ?
|
; send a report via mail ?
|
||||||
If ( MailReport$ = "yes" )
|
If ( MailReport$ = "yes" )
|
||||||
LogMe("INFO: sending mail to: " + MailTo$)
|
LogMe("INFO: sending mail to: " + MailTo$)
|
||||||
If ( LogSend(s$, Logfile$) )
|
|
||||||
LogMe("INFO: mail sent")
|
|
||||||
Else
|
|
||||||
LogMe("FATAL: could not send backup report via email...")
|
|
||||||
LogMeRaw(" please inform your Administrator !")
|
|
||||||
EndIf
|
|
||||||
EndIf
|
EndIf
|
||||||
|
|
||||||
|
; write final return code to logfile ...
|
||||||
|
LogMe("return=" + err)
|
||||||
|
|
||||||
|
; finally: send it!
|
||||||
|
If ( MailReport$ = "yes" )
|
||||||
|
LogSend(s$)
|
||||||
|
EndIf
|
||||||
|
|
||||||
; adding actual logfile to histlog...
|
; adding actual logfile to histlog...
|
||||||
If ReadFile(0, Logfile$, #PB_File_SharedRead)
|
If ReadFile(0, Logfile$, #PB_File_SharedRead)
|
||||||
While Eof(0) = 0
|
While Eof(0) = 0
|
||||||
@ -559,8 +571,8 @@ EndProg(e)
|
|||||||
|
|
||||||
; IDE Options = PureBasic 5.73 LTS (Windows - x64)
|
; IDE Options = PureBasic 5.73 LTS (Windows - x64)
|
||||||
; ExecutableFormat = Console
|
; ExecutableFormat = Console
|
||||||
; CursorPosition = 103
|
; CursorPosition = 236
|
||||||
; FirstLine = 99
|
; FirstLine = 214
|
||||||
; Folding = --
|
; Folding = --
|
||||||
; EnableXP
|
; EnableXP
|
||||||
; Executable = snapcontrol.exe
|
; Executable = snapcontrol.exe
|
||||||
|
Loading…
Reference in New Issue
Block a user