V1.09 - added silent switch and simplification
This commit is contained in:
parent
9098bc9538
commit
5dc9a6953b
BIN
snapcontrol.exe
BIN
snapcontrol.exe
Binary file not shown.
@ -29,9 +29,10 @@ EnableGraphicalConsole(0)
|
|||||||
|
|
||||||
Dim filelist$(0)
|
Dim filelist$(0)
|
||||||
|
|
||||||
Global VERSION$="V1.08"
|
Global VERSION$="V1.09"
|
||||||
Global updatesched = 0
|
Global updatesched = 0
|
||||||
Global dryrun = 0
|
Global dryrun = 0
|
||||||
|
Global silentmode = 0
|
||||||
Global hostname$ = GetEnvironmentVariable("COMPUTERNAME")
|
Global hostname$ = GetEnvironmentVariable("COMPUTERNAME")
|
||||||
Global jobname$ = "snapcontrol"
|
Global jobname$ = "snapcontrol"
|
||||||
Global month$ = FormatDate("%mm", Date())
|
Global month$ = FormatDate("%mm", Date())
|
||||||
@ -52,9 +53,10 @@ NewList DriveSnapshotVersion$()
|
|||||||
DriveSnapshotVersion$() = "V1.48"
|
DriveSnapshotVersion$() = "V1.48"
|
||||||
|
|
||||||
Procedure Usage()
|
Procedure Usage()
|
||||||
PrintN ("usage: snapcontrol.exe [ /I | /V> | /D | /? ]")
|
PrintN ("usage: snapcontrol.exe [ /S | /I | /V> | /D | /? ]")
|
||||||
|
PrintN (" /S = silent mode (no user interaction!)")
|
||||||
PrintN (" /I = install/update scheduler job")
|
PrintN (" /I = install/update scheduler job")
|
||||||
PrintN (" /V = show version")
|
PrintN (" /V = show version")
|
||||||
PrintN (" /D = dry run")
|
PrintN (" /D = dry run")
|
||||||
PrintN (" /? = help")
|
PrintN (" /? = help")
|
||||||
End 99
|
End 99
|
||||||
@ -73,6 +75,8 @@ ElseIf ( UCase(ProgramParameter(0)) = "/V" )
|
|||||||
End 0
|
End 0
|
||||||
ElseIf ( UCase(ProgramParameter(0)) = "/D" )
|
ElseIf ( UCase(ProgramParameter(0)) = "/D" )
|
||||||
dryrun = 1
|
dryrun = 1
|
||||||
|
ElseIf ( UCase(ProgramParameter(0)) = "/S" )
|
||||||
|
silentmode = 1
|
||||||
ElseIf ( ProgramParameter(0) = "/?" )
|
ElseIf ( ProgramParameter(0) = "/?" )
|
||||||
Usage()
|
Usage()
|
||||||
EndIf
|
EndIf
|
||||||
@ -338,31 +342,36 @@ If ( FtpBackup$ = "yes" )
|
|||||||
TargetPath$ = "ftp://" + TargetUser$ + "@" + FtpServer$ + TargetPath$
|
TargetPath$ = "ftp://" + TargetUser$ + "@" + FtpServer$ + TargetPath$
|
||||||
EndIf
|
EndIf
|
||||||
|
|
||||||
;
|
|
||||||
; ASK the user for permission to start ...
|
|
||||||
;
|
|
||||||
Result = MessageRequester("SnapControl",
|
|
||||||
"Start BACKUP now?" + Chr(13) +
|
|
||||||
"Targetpath => " + TargetPath$,
|
|
||||||
#PB_MessageRequester_YesNo | #PB_MessageRequester_Info)
|
|
||||||
|
|
||||||
If Result = #PB_MessageRequester_No
|
; SILENT mode.
|
||||||
|
; NO questions!
|
||||||
|
If ( silentmode = 0 )
|
||||||
|
;
|
||||||
|
; ASK the user for permission to start ...
|
||||||
|
;
|
||||||
Result = MessageRequester("SnapControl",
|
Result = MessageRequester("SnapControl",
|
||||||
"backup ABORTED.",
|
"Start BACKUP now?" + Chr(13) +
|
||||||
#PB_MessageRequester_Ok | #PB_MessageRequester_Warning)
|
"Targetpath => " + TargetPath$,
|
||||||
CloseConsole()
|
#PB_MessageRequester_YesNo | #PB_MessageRequester_Info)
|
||||||
End 0
|
|
||||||
EndIf
|
|
||||||
|
|
||||||
;
|
If Result = #PB_MessageRequester_No
|
||||||
; ASK the user for a shutdown ...
|
Result = MessageRequester("SnapControl",
|
||||||
;
|
"backup ABORTED.",
|
||||||
Result$ = InputRequester("SnapControl",
|
#PB_MessageRequester_Ok | #PB_MessageRequester_Warning)
|
||||||
"SHUTDOWN system after backup?" + Chr(13) +
|
CloseConsole()
|
||||||
" (type 'yes' or 'no')", "no")
|
End 0
|
||||||
|
EndIf
|
||||||
|
|
||||||
If LCase(Result$) = "yes"
|
;
|
||||||
DoShutdown = 1
|
; ASK the user for a shutdown ...
|
||||||
|
;
|
||||||
|
Result$ = InputRequester("SnapControl",
|
||||||
|
"SHUTDOWN system after backup?" + Chr(13) +
|
||||||
|
" (type 'yes' or 'no')", "no")
|
||||||
|
|
||||||
|
If LCase(Result$) = "yes"
|
||||||
|
DoShutdown = 1
|
||||||
|
EndIf
|
||||||
EndIf
|
EndIf
|
||||||
|
|
||||||
|
|
||||||
@ -542,7 +551,8 @@ EndProg(e)
|
|||||||
|
|
||||||
; IDE Options = PureBasic 5.73 LTS (Windows - x64)
|
; IDE Options = PureBasic 5.73 LTS (Windows - x64)
|
||||||
; ExecutableFormat = Console
|
; ExecutableFormat = Console
|
||||||
; CursorPosition = 31
|
; CursorPosition = 374
|
||||||
|
; FirstLine = 333
|
||||||
; Folding = --
|
; Folding = --
|
||||||
; EnableXP
|
; EnableXP
|
||||||
; Executable = snapcontrol.exe
|
; Executable = snapcontrol.exe
|
||||||
|
Loading…
Reference in New Issue
Block a user