Data Backup

Data Backup

Postby Otto » Fri Jul 24, 2009 10:02 pm

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
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6328
Joined: Fri Oct 07, 2005 7:07 pm

Re: Data Backup

Postby Armando » Fri Jul 24, 2009 11:35 pm

Otto:

Do you know backupbuilder ?, from our friend Timm Sodtalbers.

http://www.backupbuilder.com/

Regards
SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
User avatar
Armando
 
Posts: 3217
Joined: Fri Oct 07, 2005 8:20 pm
Location: Toluca, México

Re: Data Backup

Postby hag » Sat Jul 25, 2009 5:22 am

I use 7z 32bit free zip program. I call the files using wild card and store any where on the drive or flash drive.
Thank you
Harvey
hag
 
Posts: 598
Joined: Tue Apr 15, 2008 4:51 pm
Location: LOs Angeles, California

Re: Data Backup

Postby Otto » Sat Jul 25, 2009 6:43 am

Hello hag,

Thank you for your information.
This is exactly what I am testing right now.

May I ask you some questions:
Do you know what happens with opened files?
Do you use 7Z in an own exe-file which you start minimized?
How do you organize the zipped files?
Do you overwrite them, delete them after some time?
How do you start the backup: manually with or with a timer?

Best regards,
Otto



Code: Select all  Expand view
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      
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6328
Joined: Fri Oct 07, 2005 7:07 pm

Re: Data Backup

Postby James Bott » Sat Jul 25, 2009 12:58 pm

One really needs to make offsite backups. You might want to take a look at online backups such as http://www.Mozy.com. Or, backing up to an FTP site.

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Data Backup

Postby hag » Sat Jul 25, 2009 4:05 pm

Regarding 7z. It is called from the program not a separate exe. I have a series of data file all with a numeric extension such as .?01, .?02.
The user is asked which number to back up. Or backup all files in a zip file *.*. 7z is great. I used PKzip for 15 years. But it was 16bit. Pkzip want 3000 dollars for a license to distribute there 32bit version. They are crazy.
Here is some code.

Code: Select all  Expand view
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



I hope this makes sense to you. Works for me. I can save my data files anywhere and I have a program that will restore the files to the application. My program allows the user to work on 99 different sets of data files (each set can be 50+ files). This copy function allows them to save there work and restore on their computer or one at home or any computer as long as each computer has a copy of my app.
Thank you
Harvey
hag
 
Posts: 598
Joined: Tue Apr 15, 2008 4:51 pm
Location: LOs Angeles, California

Re: Data Backup

Postby Otto » Sat Jul 25, 2009 4:59 pm

Hello Harvey,

Thank you for your explanation.
It seems that your backup utility is more for an office environment. I am working with hotels and restaurants.

If someone maybe stops working at midnight or later he won’t answer questions the backup program asks.
If I want a backup it must run automatically. My problem at the moment is the management of the backup storage and how to start the backup.
As I have a DMS included into the software there is a lot of data and you never know what files have to be saved.
The user can drop every file he wants: zip, exe, bmp, jpg, doc, docx, msg, etc. to my DMS system.

I had a solution where I kept for example the last 7 backups. But if there appears a problem most users begin to backup and – you want believe – it could happen that they overwrite the healthy backup.

To start the backup with the windows own task manager is uncertain. If someone changes the windows password and forgets to change the task manager too the backup is not executed anymore.

At the end of the program could work but Fivewin programs are very stable and sometimes are not ended for days. I thought to run a program with autostart which has a timer and starts the backup after a given plan.

Now I use the attached code.

Best regards,
Otto


Code: Select all  Expand view
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
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6328
Joined: Fri Oct 07, 2005 7:07 pm

Re: Data Backup

Postby Otto » Sun Jul 26, 2009 9:31 am

To all,
I did some more tests. In my case if a dbf-file is opened 7Zip does not include these files into the zip archive.
Can someone confirm that.
Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6328
Joined: Fri Oct 07, 2005 7:07 pm

Re: Data Backup

Postby hag » Sun Jul 26, 2009 3:43 pm

Yes I have close all before the can zip it up.
Thank you
Harvey
hag
 
Posts: 598
Joined: Tue Apr 15, 2008 4:51 pm
Location: LOs Angeles, California

Re: Data Backup

Postby James Bott » Sun Jul 26, 2009 5:01 pm

Take a look at SynchBackSE. It is inexpensive ($30US):

http://www.2brightsparks.com/syncback/sbse.html

And it can copy open files as long as they are on the same computer (so it would have to be run on the server):

http://www.2brightsparks.com/help/index.php?action=kb&article=228

It can also create ZIPs and copy to FTP servers.

There is a review of it here: http://www.geek.com/hwswrev/software/syncback/index.htm

Regards,
James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Data Backup

Postby Otto » Sun Jul 26, 2009 6:43 pm

Hello Harvey,
thank you for your help.
For my purpose I need a backup which also includes opened files.
Hello James,
I read the review:
Needs exception handling when destination target is not available or has insufficient disk space; self-extracting backup archives can mess up


I think this software is not useable in automatic mode.


Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6328
Joined: Fri Oct 07, 2005 7:07 pm

Re: Data Backup

Postby James Bott » Sun Jul 26, 2009 8:20 pm

Otto,

I would still check into it. That review was written 4 years ago--those things may have been fixed. Email them and ask.

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Data Backup

Postby ukoenig » Sun Jul 26, 2009 8:28 pm

Otto,

I use this one and it works perfect.

Download :
http://www.fbackup.com/

FBackup is freeware backup program for Windows.
FBackup protects your important files and folders from partial or total loss by automating backup tasks,
password protecting and compressing it to save storage space.
Using FBackup you can easily backup to any local or network drive or to external drives (such as USB drives).
FBackup can backup open/locked files and it can perform full and mirror backups
(backup type that does not compress the files).
When defining a backup you can also set file filters and schedule the backup for automatic execution.
You can run predefined backups, such as My Documents, My Pictures or Outlook Express and load backup plugins that will back up the settings and data of specific applications.
FBackup has ZIP64 support (can create backups over 2 GB) and creates standard zip files,
meaning that you can access it with any zip compatible utility.
FBackup also allows you to password protect your backup.
FBackup tests the backup files automatically to ensure the backup is safe and correctly executed
(uses CRC32).
FBackup runs on Windows Vista, XP, 2000 and 2008/2003/2000 Server.
FBackup is free for both personal and commercial use.

Best Regards
Uwe :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 63 guests