Question
· Sep 26, 2017

Undefined error at the end of Cache database backup

I have a Powershell script to backup up a Cache database. The script runs through and backs up the database  with the normal 4 iterations. The script successfully produces the backup file and an associated log file. However, after completion of the backup there is what appears to be a permission error. I have not been able to find any information that would help me determine if this message impacts the integrity of the back up. From the end of the output of the backup:

Backup pass 4 complete at 09/22/2017 17:55:44

***FINISHED BACKUP***

Global references are enabled.

Backup complete.

%SYS>
<READ>
<ERRTRAP>

logtofile create error=5
logtofile create error=5
logtofile create error=5
logtofile create error=5

There are about 20 repetitions of the error message. I have worked with databases for 30 years or so but this is my first exposure to the cache database so it is apparent that I am missing something.

Powershell Script

<#
  
#>
# Define the key cache elements
$app    = 'C:\cachesys\Bin\cache'
$arg1   = '-sC:\cachesys\Mgr'
$arg2   = '-U%SYS'

# Define the cache source file
$srcFile = 'C:\cachesys\Mgr\user\cache.dat'

# Set the base location
$baseDir = 'E:\backups\cacheBackups'

# Backup date
$dt = "$(get-date -format yyyy)_$(get-date -UFormat %U)"
$timeStamp = get-date -format yyyyMMddhhmm

# Define the date based backup loc
$keyPath="$baseDir\Weekly_$dt"

# Define the log loc
$logLoc = "$keyPath\log"

# Define the target cache file copy 
$tgtFile = "$keyPath\cache.dat"

# If the backup base dir does not exist, create it
if (( Test-Path $baseDir) -eq 0)
{
    new-item $baseDir -itemtype directory   |out-null
}

# If the backup dir does not exist create it
if (( Test-Path $keyPath) -eq 0)
{
    new-item $keyPath -itemtype directory|out-null
}

# If the log dir does not exist create it
if (( Test-Path $logLoc) -eq 0)
{
    new-item $logLoc -itemtype directory|out-null
}

# Define the log file
$logDef = "$logLoc\back_$timeStamp.log"

# Define the backup file
$dmpDev = "$keyPath\cache_$timeStamp.bck"

# Clear tracking from last backup
write-output "set x=`$`$CLRINC^DBACK(`"QUIET`")" |& $app $arg1 $arg2

# Make a copy of the database
Copy-Item -Path $srcFile -Destination $tgtFile 

# backup noting external copy with the 'E' flag
write-output "set x=`$`$BACKUP^DBACK(`"`",`"F`",`"Full Backup`",`"`",`"`",`"`") " | & $app $arg1 $arg2

# Incremental backup with th 'I' flag
write-output "set x=`$`$BACKUP^DBACK(`"`",`"I`",`"Nightly`",`"$dmpDev`",`"N`",`"$logDef`",`"NOISY`",`"N`",`"Y`") "  | & $app $arg1 $arg2

write-output "Weekly backup complete"
#

The full out put from the backup executing if this is helpful (sensitive information replaced with XXX):

Node: XXXX, Instance: CACHE

%SYS>

%SYS>
<READ>
<ERRTRAP>

Node: XXX, Instance: CACHE

%SYS>

<UNDEFINED>BACKUP+71^DBACK *mode

%SYS>
<READ>
<ERRTRAP>

Node:XXX, Instance: CACHE

%SYS>

                 Cache Backup Utility
              --------------------------

You cannot do an Incremental or Cumulative Backup until a Full Backup
has been performed.

Performing a Full Backup of these databases
Performing a Full backup.
Backing up to device: e:\backups\cachebackups\2017_38\cache_201709220424.bck

Backing up the following directories:
 c:\cachesys\mgr\
 c:\cachesys\mgr\cacheaudit\
 c:\cachesys\mgr\ontariomgr\
 c:\cachesys\mgr\user\
 d:\iai1\
 d:\iai1\nojrn\
 d:\iai3\
 d:\iai3\nojrn\

Journal file switched to:
d:\journal\20170922.003

Starting backup pass 1
Backing up c:\cachesys\mgr\ at 09/22/2017 16:25:10
Copied 5387 blocks in 1.624 seconds

Finished this pass of copying c:\cachesys\mgr\

Backing up c:\cachesys\mgr\cacheaudit\ at 09/22/2017 16:25:12
Copied 61 blocks in 0.055 seconds

Finished this pass of copying c:\cachesys\mgr\cacheaudit\

Backing up c:\cachesys\mgr\ontariomgr\ at 09/22/2017 16:25:13
Copied 5234 blocks in 1.498 seconds

Finished this pass of copying c:\cachesys\mgr\ontariomgr\

Backing up c:\cachesys\mgr\user\ at 09/22/2017 16:25:16
Copied 63 blocks in 0.012 seconds

Finished this pass of copying c:\cachesys\mgr\user\

Backing up d:\iai1\ at 09/22/2017 16:25:19
Copied 18952112 blocks in 4276.176 seconds

Finished this pass of copying d:\iai1\

Backing up d:\iai1\nojrn\ at 09/22/2017 17:36:45
Copied 3109 blocks in 1.137 seconds

Finished this pass of copying d:\iai1\nojrn\

Backing up d:\iai3\ at 09/22/2017 17:36:48
Copied 4328877 blocks in 1054.025 seconds

Finished this pass of copying d:\iai3\

Backing up d:\iai3\nojrn\ at 09/22/2017 17:54:33
Copied 216 blocks in 0.276 seconds

Finished this pass of copying d:\iai3\nojrn\

Backup pass 1 complete at 09/22/2017 17:54:33

Starting backup pass 2
Backing up c:\cachesys\mgr\ at 09/22/2017 17:54:44
Copied 33 blocks in 0.113 seconds

Finished this pass of copying c:\cachesys\mgr\

Backing up c:\cachesys\mgr\cacheaudit\ at 09/22/2017 17:54:46
Copied 1 blocks in 0.009 seconds

Finished this pass of copying c:\cachesys\mgr\cacheaudit\

Backing up c:\cachesys\mgr\ontariomgr\ at 09/22/2017 17:54:47
Copied 4 blocks in 0.035 seconds

Finished this pass of copying c:\cachesys\mgr\ontariomgr\

Backing up c:\cachesys\mgr\user\ at 09/22/2017 17:54:48
Copied 1 blocks in 0.002 seconds

Finished this pass of copying c:\cachesys\mgr\user\

Backing up d:\iai1\ at 09/22/2017 17:54:50
Copied 40309 blocks in 39.484 seconds

Finished this pass of copying d:\iai1\

Backing up d:\iai1\nojrn\ at 09/22/2017 17:55:30
Copied 6 blocks in 0.013 seconds

Finished this pass of copying d:\iai1\nojrn\

Backing up d:\iai3\ at 09/22/2017 17:55:32
Copied 19 blocks in 0.026 seconds

Finished this pass of copying d:\iai3\

Backing up d:\iai3\nojrn\ at 09/22/2017 17:55:33
Copied 1 blocks in 0.002 seconds

Finished this pass of copying d:\iai3\nojrn\

Backup pass 2 complete at 09/22/2017 17:55:33

Starting backup pass 3
Backing up c:\cachesys\mgr\ at 09/22/2017 17:55:34
Copied 15 blocks in 0.011 seconds

Finished this pass of copying c:\cachesys\mgr\

Backing up c:\cachesys\mgr\cacheaudit\ at 09/22/2017 17:55:35
Copied 1 blocks in 0.002 seconds

Finished this pass of copying c:\cachesys\mgr\cacheaudit\

Backing up c:\cachesys\mgr\ontariomgr\ at 09/22/2017 17:55:36
Copied 1 blocks in 0.008 seconds

Finished this pass of copying c:\cachesys\mgr\ontariomgr\

Backing up c:\cachesys\mgr\user\ at 09/22/2017 17:55:37
Copied 1 blocks in 0.010 seconds

Finished this pass of copying c:\cachesys\mgr\user\

Backing up d:\iai1\ at 09/22/2017 17:55:38
Copied 1 blocks in 0.002 seconds

Finished this pass of copying d:\iai1\

Backing up d:\iai1\nojrn\ at 09/22/2017 17:55:39
Copied 1 blocks in 0.007 seconds

Finished this pass of copying d:\iai1\nojrn\

Backing up d:\iai3\ at 09/22/2017 17:55:41
Copied 1 blocks in 0.007 seconds

Finished this pass of copying d:\iai3\

Backing up d:\iai3\nojrn\ at 09/22/2017 17:55:42
Copied 1 blocks in 0.009 seconds

Finished this pass of copying d:\iai3\nojrn\

Backup pass 3 complete at 09/22/2017 17:55:42

Starting backup pass 4

Journal marker set at
offset 198966728 of d:\journal\20170922.003

 - This is the last pass - Suspending write daemon
Backing up c:\cachesys\mgr\ at 09/22/2017 17:55:43
Copied 1 blocks in 0.003 seconds

Finished this pass of copying c:\cachesys\mgr\

Backing up c:\cachesys\mgr\cacheaudit\ at 09/22/2017 17:55:43
Copied 1 blocks in 0.007 seconds

Finished this pass of copying c:\cachesys\mgr\cacheaudit\

Backing up c:\cachesys\mgr\ontariomgr\ at 09/22/2017 17:55:43
Copied 1 blocks in 0.007 seconds

Finished this pass of copying c:\cachesys\mgr\ontariomgr\

Backing up c:\cachesys\mgr\user\ at 09/22/2017 17:55:43
Copied 1 blocks in 0.007 seconds

Finished this pass of copying c:\cachesys\mgr\user\

Backing up d:\iai1\ at 09/22/2017 17:55:43
Copied 1 blocks in 0.008 seconds

Finished this pass of copying d:\iai1\

Backing up d:\iai1\nojrn\ at 09/22/2017 17:55:43
Copied 1 blocks in 0.002 seconds

Finished this pass of copying d:\iai1\nojrn\

Backing up d:\iai3\ at 09/22/2017 17:55:43
Copied 1 blocks in 0.003 seconds

Finished this pass of copying d:\iai3\

Backing up d:\iai3\nojrn\ at 09/22/2017 17:55:44
Copied 1 blocks in 0.009 seconds

Finished this pass of copying d:\iai3\nojrn\

Backup pass 4 complete at 09/22/2017 17:55:44

***FINISHED BACKUP***

Global references are enabled.

Backup complete.

%SYS>
<READ>
<ERRTRAP>

logtofile create error=5
logtofile create error=5
logtofile create error=5
logtofile create error=5
....
Discussion (2)1
Log in or sign up to continue