simple backup program
Moderator: Rathinagiri
simple backup program
Hi guys!
Do you remember this time, when you lost you've changed your code, saved changes and made a copy rewriting your archive, then understood mistake???
I had it today...
But, for happiness, I had a copy on third computer
So, I've decided to write small application, quick to run, to archive my *.prg and *.fmg files to archive named by timestamp.
All names are in Polish, I can translate it to English when somebody will be interested of.
The code is clearly written, I hope
Nice testing!
Regards, Marek
Do you remember this time, when you lost you've changed your code, saved changes and made a copy rewriting your archive, then understood mistake???
I had it today...
But, for happiness, I had a copy on third computer
So, I've decided to write small application, quick to run, to archive my *.prg and *.fmg files to archive named by timestamp.
All names are in Polish, I can translate it to English when somebody will be interested of.
The code is clearly written, I hope
Nice testing!
Regards, Marek
- Attachments
-
- backup.zip
- (2.84 KiB) Downloaded 535 times
Re: simple backup program
Very good your program if I can translate English to use it for backups
- Rathinagiri
- Posts: 5471
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: simple backup program
Very useful Marek. If it can be attached to IDE, that will be more helpful.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
Re: simple backup program
very nice idea Rathi! It could be wonderful to automatically create backup of source files while closing IDE.
- danielmaximiliano
- Posts: 2611
- Joined: Fri Apr 09, 2010 4:53 pm
- Location: Argentina
- Contact:
Re: simple backup program
Hi Mol:
appreciate your contribution.
in my case I use the backup of Crimson Editor.
is also incremental.
also open the FMG, so when I change the FMG with the IDE takes modificacions Crimson editor and writes well in an incremental manner.
appreciate your contribution.
in my case I use the backup of Crimson Editor.
is also incremental.
also open the FMG, so when I change the FMG with the IDE takes modificacions Crimson editor and writes well in an incremental manner.
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*
Saludos / Regards
DaNiElMaXiMiLiAnO
Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*
Saludos / Regards
DaNiElMaXiMiLiAnO
Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
Re: simple backup program
I've translated this sample to English. I've made some changes in code, too.
Write your opinions if you like/dislike it
Best regards, Marek
Write your opinions if you like/dislike it
Best regards, Marek
- Attachments
-
- backup.zip
- (3.06 KiB) Downloaded 446 times
- Pablo César
- Posts: 4059
- Joined: Wed Sep 08, 2010 1:18 pm
- Location: Curitiba - Brasil
Re: simple backup program
Very nice example Mr. Marek and wonderfull idea of Mr. Rathi!
I was translating screen and I noted you have already done, that it is very good. But you please if you want consider this my last translation, please use attached file.
Thank you for your sharing !
Best regards,
I was translating screen and I noted you have already done, that it is very good. But you please if you want consider this my last translation, please use attached file.
Thank you for your sharing !
Best regards,
- Attachments
-
- backup.rar
- (1.34 KiB) Downloaded 419 times
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
- esgici
- Posts: 4543
- Joined: Wed Jul 30, 2008 9:17 pm
- DBs Used: DBF
- Location: iskenderun / Turkiye
- Contact:
Re: simple backup program
Hi
A few suggestions :
For function main() :
For function MakeBackup() :
Content of my FilKinds.lst :
I wish you will like it
Regards
--
Esgici
A few suggestions :
For function main() :
Code: Select all
PRIVATE cFileKinds_FNam := "FilKinds.lst",; // File kinds file name
cFileKinds := "",; // File kinds string
aFileKinds := {} // File kinds array
IF FILE( cFileKinds_FNam )
cFileKinds := MEMOREAD( cFileKinds_FNam) // File kinds string
IF !EMPTY( cFileKinds )
aFileKinds := HB_ATOKENS( cFileKinds, CRLF )
ENDIF
ENDIF
IF EMPTY( aFileKinds )
aFileKinds := { "PRG", "FMG" }
ENDIF
AEVAL( aFileKinds, { | c1, i1 | aFileKinds[ i1 ] := "*." + c1 } )
For function MakeBackup() :
Code: Select all
BackUp.ProgressIndicator.Visible := .t.
/*
from clipper docs :
ADIR() is a compatibility function and therefore not recommended. It is
superseded by the DIRECTORY() function which returns all file
information in a multidimensional array.
moreover ...
ADIR() require calling twice :(
*/
FOR EACH cFileKind IN aFileKinds
aTemp := DIRECTORY( cFileKind )
AEVAL( aTemp, { | a1 | AADD( aFilesToBackup, a1[ 1 ] ) } )
NEXT
IF EMPTY( aFilesToBackup )
MsgStop( "No file found to backup !", " ERROR !" )
ELSE
BackUp.ProgressIndicator.RangeMax := len(aFilesToBackup)
BackUp.ProgressIndicator.Value := 0
COMPRESS aFilesToBackup ;
TO cArchiveName ;
BLOCK {|cFile,nPos| BackUp.ProgressIndicator.Value := nPos } ;
OVERWRITE
// You can save backub settings here
//SaveBackupConfiguration()
lBackupStatus := .t.
msgbox("Backup created successful!")
ENDIF
BackUp.Release
return
*-------------------
For all files, a single "*" is sufficientch
prg
fmg
hbp
hbc
log
lst
I wish you will like it
Regards
--
Esgici
Viva INTERNATIONAL HMG