Button to create a backup of a file including Date/Time

I have spent the last couple of days searching the internet and this forum to no avail. So I am going to post hoping that someone out there can assist.

Problem: I would like to have a DOpus button, that when clicked, will (1) Make a backup copy of the selected file named in the following manner:
Original File Name: MyDocument.docx
New File Name (After button click): MyDocument -- 20120207.docx

Result: After clicking the button I now have two files, MyDocument.docx & MyDocument -- 20120207.docx in the same directory

Research and conclusions thus far:
1) I have seen the following http://www.pretentiousname.com/opus/cb1.html, which discusses rename patterns - this one works: Rename PATTERN="*.*" TO="* - {date|yyyy-MM-dd} {time|HH-mm-ss}.*" AUTORENAME TYPE=files
2) I have played with the COPY AS, and various permutations, but do not want to copy to the dest. lister
3) Using the HERE command, to augment the above COPY AS, places the copies file in the source lister, but does not automatically rename the file

So while the rename pattern above does the correct rename function, I am not sure how to incorporate that into a button click.

Thoughts :question:

Many Thanks

Try this:

Copy DUPLICATE FILE AS "{file$|noext} -- {date|yyyyMMdd}{file$|ext}"

Thanks Leo! :thumbsup:

I love DOpus!

Hi I am new :wink:

Most of the times I can find my info right here but now I have a question about this backup thing.

In my situation I have multiple files selected.
When I click my 'backup files' button I want it to create a new folder with date/time as name.
Then the selected files have to be renamed and copied into this new folder.

Code used so far for create a folder:

CreateFolder NAME="{date|yyyy-MM-dd}-{time|HH-mm-ss}" 

Code I want to use for renaming:

Copy DUPLICATE FILE AS "{file$|noext} -- {date|yyyyMMdd}{file$|ext}"

How do I get the renamed duplicated files into the new folder?
I want this all in one button if possible :smiley:

Try this:

@nofilenamequoting Copy HERE AS "{file$|noext} -- {date|yyyyMMdd}{file$|ext}" CREATEFOLDER "{date|yyyy-MM-dd}-{time|HH-mm-ss}"

Great it works :thumbsup:

I did a little modification to your code because I want all backups in the same folder.
Now this is working I want to go to the next step. (if possible)
It would be nice if the files are zipped inside the bakup folder.

I already tried the following code:

@nofilenamequoting Copy ARCHIVE HERE AS "{file$|noext} -- {date|yyyy-MM-dd} -- {time|HH-mm-ss}{file$|ext}" CREATEFOLDER "#Backup"

But the result is that the '#Backup" folder gets zipped. I only want to zip the files inside the folder.


It's best to ask for what you really want up-front as the details may change the previous answers and make them a waste of time. :slight_smile:

When zipping, the CREATEFOLDER argument specifies the name of the zip file. That command should not be zipping the #Backup folder (if one exists already), it should be zipping whatever is selected and putting it into a #Backup.zip