Help creating button to put config backup into dated dir

I'd like to make a custom button that will first create a folder with the current date as the name, and after that to create a config backup file that goes into the newly created folder.

I know how to create a folder with the current date, and I know how to create a config backup file that is stored into a particular folder.

My problem is, I do not know how to get Directory Opus to create a folder with the current date, and then create a config backup file into that folder, because the name of that folder will always be changing, depending on what the new date is.

As an example, I use this button command to create a config backup file, and put into a static folder who's name never changes:

Prefs BACKUP=all TO "F:\Data Backups\Directory Opus Backup Files\Directory Opus Config Backups/Ob - Opus Config - {date|MM-dd-YYYY}" Quiet

So, what I'm looking for is to see if it's possible to get Directory Opus to perform the above command, after it first completes a command of: CreateFolder NAME="{date|MM-dd-yyyy}"

Hopefully this question makes some sort of sense? I would just like a custom button that creates a folder with the current date, and puts a config backup file into it.

I would greatly appreciate any help!

Oblias2

You already have everything you need:

CreateFolder NAME="{date|MM-dd-yyyy}"
Prefs BACKUP=all TO "{date|MM-dd-yyyy}/Ob - Opus Config - {date|MM-dd-YYYY}" Quiet

Thanks for the reply, and it pointed out a couple of things I did not mention. I didn't say that I want the one custom button to perform that task in 2 different locations, for redundancy. My current button does that because I plug in the path to the first folder, and then on the next line I plug in the path to the second folder.

I'd rather just have one button for this task, rather than two buttons.

Also, using the solution you posted, I do not know how the button is doing a 'CreateFolder' in a specific location. If I'm in an active lister for my C: drive, and want the date folder to be created on another drive, I fail to see how that is done using your solution.....

Try

CreateFolder NAME="D:\a\specific\location\{date|MM-dd-yyyy}"
Prefs BACKUP=all TO "D:\a\specific\location\{date|MM-dd-yyyy}/Ob - Opus Config - {date|MM-dd-YYYY}" QUIET

CreateFolder NAME="E:\a\second\folder\{date|MM-dd-yyyy}"
Prefs BACKUP=all TO "E:\a\second\folder\{date|MM-dd-yyyy}/Ob - Opus Config - {date|MM-dd-YYYY}" QUIET

P.S.: yyyy and YYYY are not the same: Codes for date and time

2 Likes

That works like a charm!! You are a Wizard, and have been a very big help to me. Thank you VERY much!!!

PS: I also see what you mean by the difference in the two year codes. I appreciate you pointing that out. I swear, a person can spend a lifetime learning all the nuances in Directory Opus!