To all,
Data backup for my programs is a very important task for me.
I would be interested how you handle the backup.
Best regards,
Otto
MENUITEM "Rechnungsordner sichern" ;
ACTION zippen(setup():daten + "datazirg","DataZiRg") ;
MESSAGE "Rechnungsordner sichern"
function zippen(cSrc,Praefix)
LOCAL DCOM := ""
local cDocNr := ALLTRIM( STR( extbookingNUM() ) )
*----------------------------------------------------------
//adds all files and subfolders from folder subdir to archive archive.zip.
DCOM := '7z a -tzip ' + setup():cWHBackup + "\" + Praefix + cDocNr + '.zip' + ' -ir!' + cSrc + '\*.*'
msginfo(DCOM)
WAITRUN(DCOM,0)
msginfo("OK")
return nil
function savit()
local cName,cNumber,cDrive,cNumber2,aDrive
local cFile,oDlg1,oGet1,oFont7,mHelp := 0
local mForgetthis
local cSayit := "Please enter the entity number of the files to be included in the zip file."
local oSay1
local cWhereamI
local lClosedIt := .F.
local mMoveOn := .T.
local oGet
local getName
DEFINE FONT oFont7 NAME "Ms Sans Serif" SIZE 0,-12
DEFINE DIALOG oDlg1 RESOURCE "copy6" OF oWnd1 helpid mhelp font ofont7
REDEFINE GET OGET VAR cNumber ID 103 OF ODLG1 PICTURE "99" //update valid(mDecide2(mVar,mcmpnum))
REDEFINE BUTTON ID 4001 OF oDlg1 ACTION (oDlg1:End())
REDEFINE BUTTON ID 4002 OF oDlg1 ACTION (oDlg1:End(),mMoveOn := .f.) //,odlg1:destroy())
ACTIVATE DIALOG oDlg1 centered
if mMoveOn == .F.
return nil
endif
cNumber := trim(cNumber)
if cNumber == "1" .OR. cNumber == "2" .OR.;
cNumber == "3" .OR. cNumber == "4" .OR.;
cNumber == "5" .OR. cNumber == "6" .OR.;
cNumber == "7" .OR. cNumber == "8" .OR.;
cNumber == "9" .OR. cNumber == "0"
cNumber := "0"+cNumber
endif
if !file("gl.d"+cNumber)
msgalert("The entity you have selected does not exist. Please try again.")
return nil
else
cGetName := alltrim(getTheName(cNumber,1))
cDrive := cGetFile(cGetName+cNumber+".zip","Indicate The Directory/Entity Number To Be Copied to!")
cDrive := left(cDrive,len(cDrive)-(len(cGetName)+6))
if cDrive == curDrive()+":\"+curdir()+"\"
MsgInfo("To copy the file to the current directory please use the 'Zip it' section of the program!")
return nil
endif
if EMPTY(cDrive)
msgStop("You have failed to select a drive!")
return nil
endif
cNumber2 := cNumber
if cNumber == "00"
cNumber2 := whichCopy()
endif
cFile := "SAV"+cNumber+".ZIP" //+" *.?"+cNumber2
close all
winexec("7z a "+cFile+" *.?"+cNumber2)
cursorarrow()
aDrive := curdir()
aDrive := aDrive+"\"
msgWait("One moment","Please",1)
close all
copy file("SAV"+cNumber+".ZIP") to (cDrive+cGetName+cNumber+".ZIP")
msgalert("Your file is: "+cDrive+alltrim(cGetName)+cNumber+".zip"+" Please make a note of the name and location.")
cursorarrow()
endif
return nil
function zippen(cSrc,Praefix,Aufruf,STRDatum)
LOCAL DCOM := ""
local cDocNr := ALLTRIM( STR( extbookingNUM() ) )
*----------------------------------------------------------
if aufruf = "WINHOTEL"
//adds all files and subfolders from folder subdir to archive archive.zip.
DCOM := '7z a -tzip ' + setup():cWHBackup + "\" + STRDatum + "\" + Praefix + cDocNr + '.zip' +;
' -ir!' + cSrc + '\*.*' + ;
' -xr!' + cSrc + '\*.exe' + ;
' -xr!' + cSrc + '\*.zip' +;
' -xr!' + cSrc + '\*.Manifest' +;
' -xr!' + cSrc + '\*.dll' +;
' -xr!' + cSrc + '\*.cdx' +;
' -xr!' + cSrc + '\*.chm' +;
' -xr!' + cSrc + '\*.bmp' +;
' -xr!' + cSrc + '\*.ico' +;
' -xr!' + cSrc + '\*.dbu'
elseif aufruf = "DATEN"
DCOM := '7z a -tzip ' + setup():cWHBackup + "\" + STRDatum + "\" + Praefix + cDocNr + '.zip' +;
' -ir!' + cSrc + '\*.*' + ;
' -xr!' + cSrc + '\*.exe' + ;
' -xr!' + cSrc + '\*.Manifest' +;
' -xr!' + cSrc + '\*.dll' +;
' -xr!' + cSrc + '\*.cdx' +;
' -xr!' + cSrc + '\*.dbu'
endif
WAITRUN(DCOM,0)
msginfo("OK")
return nil
Needs exception handling when destination target is not available or has insufficient disk space; self-extracting backup archives can mess up
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 90 guests