Get 4D file(Last backup file) v17.4 returning wrong file path

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Get 4D file(Last backup file) v17.4 returning wrong file path

4D Tech mailing list
Hi,

In my "On Backup Shutdown" method I wanted to copy the backup file to
another disk.
When I call "Get 4D file(Last backup file)" I get a file path to a
very old backup. I get the same old path every time I do a backup.

Am I missing something?

Thanks,

dave

--
David Nasralla
Clean Air Engineering
**********************************************************************
4D Internet Users Group (4D iNUG)
New Forum: https://discuss.4D.com
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|

Re: Get 4D file(Last backup file) v17.4 returning wrong file path

4D Tech mailing list
sidebar

technically you should move your fresh 4BK file after On Backup Shutdown, not during,
because 4D updates the backup history json file following the database event,
and a  missing backup file will trigger a runtime error.
one way to avoid this is to start a new process and wait a little before moving the backup.

I can't answer your question about Get 4D file + Last backup file
other than to assume that the information is only updated after On Backup Shutdown.

https://doc.4d.com/4Dv18R4/4D/18-R4/Get-4D-file.301-4982837.en.html

2020/08/19 5:44、Dave Nasralla via 4D_Tech <[hidden email]<mailto:[hidden email]>>のメール:
In my "On Backup Shutdown" method I wanted to copy the backup file to
another disk.
**********************************************************************
4D Internet Users Group (4D iNUG)
New Forum: https://discuss.4D.com
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|

Re: Get 4D file(Last backup file) v17.4 returning wrong file path

4D Tech mailing list
Thanks for the advice, Keisuke.

The command seems to work in a blank database (just running it in a
test method after doing a backup), but does not work in my main system
in a test method.
This makes me think something got corrupt. Do you know where the "Last
backup file" path information is stored?

dave

On Tue, Aug 18, 2020 at 5:09 PM Keisuke Miyako via 4D_Tech
<[hidden email]> wrote:

>
> sidebar
>
> technically you should move your fresh 4BK file after On Backup Shutdown, not during,
> because 4D updates the backup history json file following the database event,
> and a  missing backup file will trigger a runtime error.
> one way to avoid this is to start a new process and wait a little before moving the backup.
>
> I can't answer your question about Get 4D file + Last backup file
> other than to assume that the information is only updated after On Backup Shutdown.
>
> https://doc.4d.com/4Dv18R4/4D/18-R4/Get-4D-file.301-4982837.en.html
>
> 2020/08/19 5:44、Dave Nasralla via 4D_Tech <[hidden email]<mailto:[hidden email]>>のメール:
> In my "On Backup Shutdown" method I wanted to copy the backup file to
> another disk.
> **********************************************************************
> 4D Internet Users Group (4D iNUG)
> New Forum: https://discuss.4D.com
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:[hidden email]
> **********************************************************************



--
David Nasralla
Clean Air Engineering
**********************************************************************
4D Internet Users Group (4D iNUG)
New Forum: https://discuss.4D.com
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|

Re: Get 4D file(Last backup file) v17.4 returning wrong file path

4D Tech mailing list
in v18 it is backupHistory.json, I think.

https://doc.4d.com/4Dv18R3/4D/18-R3/Configuration-and-trace-files.300-4919427.en.html

2020/08/19 9:21、Dave Nasralla via 4D_Tech <[hidden email]<mailto:[hidden email]>>のメール:
This makes me think something got corrupt. Do you know where the "Last
backup file" path information is stored?

**********************************************************************
4D Internet Users Group (4D iNUG)
New Forum: https://discuss.4D.com
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|

Re: Get 4D file(Last backup file) v17.4 returning wrong file path

4D Tech mailing list
It turns out 3 out of 4 of my systems have this issue. The last backup path
does show up correctly in the backup.xml file in the Preferences folder,
but the command still fails. I’ve opened a case with Tech Support and have
them a sample database. We’ll see what they find out.

Thanks for your help.

Dave

On Tue, Aug 18, 2020 at 6:54 PM Keisuke Miyako via 4D_Tech <
[hidden email]> wrote:

> in v18 it is backupHistory.json, I think.
>
>
>
>
> https://doc.4d.com/4Dv18R3/4D/18-R3/Configuration-and-trace-files.300-4919427.en.html
>
>
>
> 2020/08/19 9:21、Dave Nasralla via 4D_Tech <[hidden email]<mailto:
> [hidden email]>>のメール:
>
> This makes me think something got corrupt. Do you know where the "Last
>
> backup file" path information is stored?
>
>
>
> **********************************************************************
>
> 4D Internet Users Group (4D iNUG)
>
> New Forum: https://discuss.4D.com
>
> Archive:  http://lists.4d.com/archives.html
>
> Options: https://lists.4d.com/mailman/options/4d_tech
>
> Unsub:  mailto:[hidden email]
>
> **********************************************************************

--
David Nasralla
Clean Air Engineering
**********************************************************************
4D Internet Users Group (4D iNUG)
New Forum: https://discuss.4D.com
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|

Re: Get 4D file(Last backup file) v17.4 returning wrong file path

4D Tech mailing list
Just a followup.
Tech support has filed a bug for the issue. It's a command that not
many people use I'm guessing. I've just started using it to move a 4D
Backup to a BackBlaze folder once a week so it can be backed up on the
weekend to the cloud. During the week, we just backup the daily
journal files.

It turns out 4 out of 5 of my systems fail with this command.
My workaround to get the path is a simple routine to read the XML Backup file.
It seems to work fine in v17. Have not tried in v18.

  // ----------------------------------------------------
  // Method: UT_LastBackupFilePath
  // Method Path: UT_LastBackupFilePath
  // Description
  // Work Around for failed 4D Command "Get 4D File(Last backup file)"
  //
  // Parameters
  // ----------------------------------------------------

C_TEXT($0;$PathToLastBackup_vt)

C_BLOB($BackupFileBlob_vx)
C_TEXT($xml_Struct_Ref;$ElementRef_vt)

DOCUMENT TO BLOB(Get 4D file(Backup configuration file);$BackupFileBlob_vx)

$xml_Struct_Ref:=DOM Parse XML variable($BackupFileBlob_vx)
$ElementRef_vt:=DOM Find XML
element($xml_Struct_Ref;"/Preferences4D/Backup/DataBase/LastBackupPath/Item1")

DOM GET XML ELEMENT VALUE($ElementRef_vt;$PathToLastBackup_vt)

$0:=$PathToLastBackup_vt

I'm kind of interested in a straw poll. I'll post it in another thread.

dave

On Wed, Aug 19, 2020 at 5:47 PM Dave Nasralla <[hidden email]> wrote:

>
> It turns out 3 out of 4 of my systems have this issue. The last backup path does show up correctly in the backup.xml file in the Preferences folder, but the command still fails. I’ve opened a case with Tech Support and have them a sample database. We’ll see what they find out.
>
> Thanks for your help.
>
> Dave
>
> On Tue, Aug 18, 2020 at 6:54 PM Keisuke Miyako via 4D_Tech <[hidden email]> wrote:
>>
>> in v18 it is backupHistory.json, I think.
>>
>>
>>
>> https://doc.4d.com/4Dv18R3/4D/18-R3/Configuration-and-trace-files.300-4919427.en.html
>>
>>
>>
>> 2020/08/19 9:21、Dave Nasralla via 4D_Tech <[hidden email]<mailto:[hidden email]>>のメール:
>>
>> This makes me think something got corrupt. Do you know where the "Last
>>
>> backup file" path information is stored?
>>
>>
>>
>> **********************************************************************
>>
>> 4D Internet Users Group (4D iNUG)
>>
>> New Forum: https://discuss.4D.com
>>
>> Archive:  http://lists.4d.com/archives.html
>>
>> Options: https://lists.4d.com/mailman/options/4d_tech
>>
>> Unsub:  mailto:[hidden email]
>>
>> **********************************************************************
>
> --
> David Nasralla
> Clean Air Engineering



--
David Nasralla
Clean Air Engineering
**********************************************************************
4D Internet Users Group (4D iNUG)
New Forum: https://discuss.4D.com
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|

Re: Get 4D file(Last backup file) v17.4 returning wrong file path

4D Tech mailing list
Thank you Dave, this nice piece of code one I needed just now.

Bernd

Am Di., 25. Aug. 2020 um 17:12 Uhr schrieb Dave Nasralla via 4D_Tech <
[hidden email]>:

> Just a followup.
> Tech support has filed a bug for the issue. It's a command that not
> many people use I'm guessing. I've just started using it to move a 4D
> Backup to a BackBlaze folder once a week so it can be backed up on the
> weekend to the cloud. During the week, we just backup the daily
> journal files.
>
> It turns out 4 out of 5 of my systems fail with this command.
> My workaround to get the path is a simple routine to read the XML Backup
> file.
> It seems to work fine in v17. Have not tried in v18.
>
>   // ----------------------------------------------------
>   // Method: UT_LastBackupFilePath
>   // Method Path: UT_LastBackupFilePath
>   // Description
>   // Work Around for failed 4D Command "Get 4D File(Last backup file)"
>   //
>   // Parameters
>   // ----------------------------------------------------
>
> C_TEXT($0;$PathToLastBackup_vt)
>
> C_BLOB($BackupFileBlob_vx)
> C_TEXT($xml_Struct_Ref;$ElementRef_vt)
>
> DOCUMENT TO BLOB(Get 4D file(Backup configuration file);$BackupFileBlob_vx)
>
> $xml_Struct_Ref:=DOM Parse XML variable($BackupFileBlob_vx)
> $ElementRef_vt:=DOM Find XML
>
> element($xml_Struct_Ref;"/Preferences4D/Backup/DataBase/LastBackupPath/Item1")
>
> DOM GET XML ELEMENT VALUE($ElementRef_vt;$PathToLastBackup_vt)
>
> $0:=$PathToLastBackup_vt
>
> I'm kind of interested in a straw poll. I'll post it in another thread.
>
> dave
>
> On Wed, Aug 19, 2020 at 5:47 PM Dave Nasralla <[hidden email]> wrote:
> >
> > It turns out 3 out of 4 of my systems have this issue. The last backup
> path does show up correctly in the backup.xml file in the Preferences
> folder, but the command still fails. I’ve opened a case with Tech Support
> and have them a sample database. We’ll see what they find out.
> >
> > Thanks for your help.
> >
> > Dave
> >
> > On Tue, Aug 18, 2020 at 6:54 PM Keisuke Miyako via 4D_Tech <
> [hidden email]> wrote:
> >>
> >> in v18 it is backupHistory.json, I think.
> >>
> >>
> >>
> >>
> https://doc.4d.com/4Dv18R3/4D/18-R3/Configuration-and-trace-files.300-4919427.en.html
> >>
> >>
> >>
> >> 2020/08/19 9:21、Dave Nasralla via 4D_Tech <[hidden email]<mailto:
> [hidden email]>>のメール:
> >>
> >> This makes me think something got corrupt. Do you know where the "Last
> >>
> >> backup file" path information is stored?
> >>
> >>
> >>
> >> **********************************************************************
> >>
> >> 4D Internet Users Group (4D iNUG)
> >>
> >> New Forum: https://discuss.4D.com
> >>
> >> Archive:  http://lists.4d.com/archives.html
> >>
> >> Options: https://lists.4d.com/mailman/options/4d_tech
> >>
> >> Unsub:  mailto:[hidden email]
> >>
> >> **********************************************************************
> >
> > --
> > David Nasralla
> > Clean Air Engineering
>
>
>
> --
> David Nasralla
> Clean Air Engineering
> **********************************************************************
> 4D Internet Users Group (4D iNUG)
> New Forum: https://discuss.4D.com
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:[hidden email]
> **********************************************************************
**********************************************************************
4D Internet Users Group (4D iNUG)
New Forum: https://discuss.4D.com
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[hidden email]
**********************************************************************