KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Check the status of a backup
PRODUCT: 4D Backup | VERSION: 13.2 | PLATFORM: Mac & Win
Published On: April 12, 2013

Creating backups in 4D is highly recommended for all customer. The backup allows developers to recover in case of an unforeseen catastrophe that might occur such as power outages, hardware malfunctions, etc. Backups give developers the ability to restore the data, but what if a backup failed?

If the backup fails, you can catch it before it becomes an issue by creating a method in the "On Backup Shutdown". The documentation (https://doc.4d.com/4Dv12.4/help/Title/en/page2058.html) states: "If the backup was executed correctly, $1 equals 0."

If the backup failed, methods can be used to check the backup folder, record the backup using Log Event, notify the database administrator with an email of the backup status, or however the developer would like to handle the scheduled backup.

In the On Database Methods select On Backup Shutdown and enter the following:

C_LONGINT($1)
If ($1#0)
 <>schedulebackup_b:=False
//check timestamp of last 4BK and 4BL
//record backup attempt to log
//email admin
Else
 <>schedulebackup_b:=True
//record backup attempt to log
End if