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

2020-09-17 Thread B.Bippus via 4D_Tech
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 <
4d_tech@lists.4d.com>:

> 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  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 <
> 4d_tech@lists.4d.com> 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 <4d_tech@lists.4d.com 4d_tech@lists.4d.com>>のメール:
> >>
> >> 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:4d_tech-unsubscr...@lists.4d.com
> >>
> >> **
> >
> > --
> > 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:4d_tech-unsubscr...@lists.4d.com
> **
**
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:4d_tech-unsubscr...@lists.4d.com
**

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

2020-08-25 Thread Dave Nasralla via 4D_Tech
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  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 
> <4d_tech@lists.4d.com> 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 
>> <4d_tech@lists.4d.com>のメール:
>>
>> 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:4d_tech-unsubscr...@lists.4d.com
>>
>> **
>
> --
> 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:4d_tech-unsubscr...@lists.4d.com
**

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

2020-08-19 Thread Dave Nasralla via 4D_Tech
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 <
4d_tech@lists.4d.com> 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 <4d_tech@lists.4d.com 4d_tech@lists.4d.com>>のメール:
>
> 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:4d_tech-unsubscr...@lists.4d.com
>
> **

-- 
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:4d_tech-unsubscr...@lists.4d.com
**

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

2020-08-18 Thread Keisuke Miyako via 4D_Tech
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 
<4d_tech@lists.4d.com>のメール:
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:4d_tech-unsubscr...@lists.4d.com
**

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

2020-08-18 Thread Dave Nasralla via 4D_Tech
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
<4d_tech@lists.4d.com> 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 
> <4d_tech@lists.4d.com>のメール:
> 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:4d_tech-unsubscr...@lists.4d.com
> **



-- 
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:4d_tech-unsubscr...@lists.4d.com
**

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

2020-08-18 Thread Keisuke Miyako via 4D_Tech
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 
<4d_tech@lists.4d.com>のメール:
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:4d_tech-unsubscr...@lists.4d.com
**