FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Data Backup
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Data Backup
Posted: 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

Posts: 3358
Joined: Fri Oct 07, 2005 08:20 PM
Re: Data Backup
Posted: 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
Posts: 598
Joined: Tue Apr 15, 2008 04:51 PM
Re: Data Backup
Posted: Sat Jul 25, 2009 05: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
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: Data Backup
Posted: Sat Jul 25, 2009 06: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 (fw): Select all Collapse
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
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: Data Backup
Posted: 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
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 598
Joined: Tue Apr 15, 2008 04:51 PM
Re: Data Backup
Posted: Sat Jul 25, 2009 04: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 (fw): Select all Collapse
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
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: Data Backup
Posted: Sat Jul 25, 2009 04: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 (fw): Select all Collapse
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
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: Data Backup
Posted: Sun Jul 26, 2009 09: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

Posts: 598
Joined: Tue Apr 15, 2008 04:51 PM
Re: Data Backup
Posted: Sun Jul 26, 2009 03:43 PM

Yes I have close all before the can zip it up.

Thank you

Harvey
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: Data Backup
Posted: Sun Jul 26, 2009 05: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
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Re: Data Backup
Posted: Sun Jul 26, 2009 06: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
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: Data Backup
Posted: Sun Jul 26, 2009 08: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

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: Data Backup
Posted: Sun Jul 26, 2009 08: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 :-)
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.

Continue the discussion