All,
Further to my last post, I have developed a way to automatically zip my files on exit of the application. But I have one problem with the zip command. If I use Winzip, on which I think this is based, it allows me to zip an entire folder. This is helpful, because when I restore it or unzip it, I just have to do so into the main Alpha5 folder where all my apps are stored. But the file.zip() command works only if you supply it with a wildcard extension \*.*, which is ok, but does provide some problems as I have some one way and some another.
As an aside, can we see the underlying code that is associated with the A5 automated backup containing the "Compact database", etc.? That might help me too.
For anyone who cares, here is the code I worked out to provide unique zip file names:
'Date Created: 26-Sep-2006 05:48:35 PM
'Last Updated: 27-Sep-2006 02:10:50 PM
'Created By : choens
'Updated By : choens
'Note: Ident.dbf contains various values that can be examined in
'order to determine if the backup has run.
t=table.open("ident")
but=alltrim(t.zipto)
buf=alltrim(t.backupfrom)
lbun=t.Lastbackupname
lbud=t.Lastbackupdate
lbut=t.Lastbackuptime
lbuid=t.lastbackupider
dim yfl as c
dim mfl as c
dim dfl as c
dim lfl as c
dim ider as c
dim global lflfull as c
lfl=""
yfl=alltrim(str(year(date())))
if month_number(cmonth(date()))<10
mfl="0"+month_number(cmonth(date()))
else
mfl=month_number(cmonth(date()))
end if
if day(date())<10
dfl="0"+day(date())
else
dfl=day(date())
end if
if date()=t.lastbackupdate
lbuid=increment_value(lbuid)
else
lbuid="a"
end if
lfl="RA_"+yfl+"_"+mfl+"_"+dfl+lbuid
t.change_begin()
t.lastbackupname=lfl
t.lastbackupdate=date()
t.lastbackuptime=time()
t.lastbackupider=lbuid
t.change_end()
lflfull=but+lfl+".zip"
file.zip(lflfull,buf)
Charlie
Further to my last post, I have developed a way to automatically zip my files on exit of the application. But I have one problem with the zip command. If I use Winzip, on which I think this is based, it allows me to zip an entire folder. This is helpful, because when I restore it or unzip it, I just have to do so into the main Alpha5 folder where all my apps are stored. But the file.zip() command works only if you supply it with a wildcard extension \*.*, which is ok, but does provide some problems as I have some one way and some another.
As an aside, can we see the underlying code that is associated with the A5 automated backup containing the "Compact database", etc.? That might help me too.
For anyone who cares, here is the code I worked out to provide unique zip file names:
'Date Created: 26-Sep-2006 05:48:35 PM
'Last Updated: 27-Sep-2006 02:10:50 PM
'Created By : choens
'Updated By : choens
'Note: Ident.dbf contains various values that can be examined in
'order to determine if the backup has run.
t=table.open("ident")
but=alltrim(t.zipto)
buf=alltrim(t.backupfrom)
lbun=t.Lastbackupname
lbud=t.Lastbackupdate
lbut=t.Lastbackuptime
lbuid=t.lastbackupider
dim yfl as c
dim mfl as c
dim dfl as c
dim lfl as c
dim ider as c
dim global lflfull as c
lfl=""
yfl=alltrim(str(year(date())))
if month_number(cmonth(date()))<10
mfl="0"+month_number(cmonth(date()))
else
mfl=month_number(cmonth(date()))
end if
if day(date())<10
dfl="0"+day(date())
else
dfl=day(date())
end if
if date()=t.lastbackupdate
lbuid=increment_value(lbuid)
else
lbuid="a"
end if
lfl="RA_"+yfl+"_"+mfl+"_"+dfl+lbuid
t.change_begin()
t.lastbackupname=lfl
t.lastbackupdate=date()
t.lastbackuptime=time()
t.lastbackupider=lbuid
t.change_end()
lflfull=but+lfl+".zip"
file.zip(lflfull,buf)
Charlie