Automate Restore of DO13 Config

I'm trying top automate restoring DO13 with the following code:

@Set FolderName "{dlgstringS|Directory Opus Restore\n\nPlease enter the folder name.\n|"M:\Drive T\Software Docs\Utils\DO\Backup}""
Prefs RESTORE=replace,all FROM {$FolderName}

I intentionally omitted the .ocb file name because the file name always changes depending on the backup time as the file name includes a timestamp. I was hoping the folder would at least open so I could then pick the most current backup. It opens to a folder but not to the one in the code. Is there a fix for this? TIA

You'd need a script to search for the most recent *.ocb file in that folder and restore it.

If you're automating config restores, you may also be automating the backups. If so, you could change whatever makes the backup to always use the same filename (and maybe also create a dated copy so it isn't overwritten on the next backup). Then things are much more simple, as the latest backup always has a fixed name.

I use two buttons for maximum control.

GO PATH="/dropbox\System\Opus\ocb"
Select NONE
Select PATTERN=*.ocb DATE=newest SETFOCUS
Select SHOWFOCUS
@disablenosel:numfiles=1,type=*.ocb
@nodeselect
Prefs RESTORE=replace,all FROM={filepath$} QUIET
1 Like

I had thought to use the same name for the backup file. I did not have your creative and efficient suggestion to create a dated copy so it isn't overwritten on the next backup. Thanks.

Here is the code I'm now using:

@Set FileName "{dlgstringS|Backup Directory Opus\n\nPlease enter the file name stem for the backup.\n|BackupDO}"
@Set FolderName "{dlgstringS|Backup Directory Opus\n\nPlease enter the folder name for the backup.\n|"T:\Software Docs\Utils\DO\Backups\"}"
@Set FolderName2 "{dlgstringS|Backup Directory Opus\n\nPlease enter the folder name for the timestamped copy copied to old backups.\n|"T:\Software Docs\Utils\DO\Backups\Old Backups\"}"
Prefs BACKUP=all TO={$FolderName}{$FileName}.ocb
Copy {$FolderName}\{$FileName}.ocb TO {$FolderName2} AS "{$FileName} {date|yyyy-MM-dd}@{time|HH-mm-ss}.ocb"
//
//Prefs BACKUP=all TO="T:\Software Docs\Utils\DO\Backups\BackupDO.ocb"
//Copy "T:\Software Docs\Utils\DO\Backups\BackupDO.ocb" TO "T:\Software Docs\Utils\DO\Backups\Old Backups\" AS "BackupDO {date|yyyy-MM-dd}@{time|HH-mm-ss}.ocb"

The code commented out is completely hard-wired. The code above it, that I use, let's you see where files are going.