Create backup button : need help

I can save configuration directly with opus when i use in usb so i create this...

  • create filter "backup" to select folders/files
buttons|collections|configfiles|filetypes|filters|formats|global data|icons|images|layouts|listerstyles|logs|program state|rename presets|state data|tabgroups|themes|tools|usercommands|userdata.omd|dopus.cert
  • button

go /home Select Backup FILTER Copy ZIP TO to="/home\..\DO9\+ Backup +" go "/home\..\DO9\+ Backup +" select "buttons.zip" rename "buttons.zip" to="DO_USB_Backup_{date|yyyy-MM-dd}.obk" AUTORENAME

  • and i add *.obk type file extension to be open like zip with DO.

first strange thing... the first folder ("buttons" when sorting by name) selected are not zipped. but maybe i missed something ?

so i create a temp folder in /home directory named "aaa", add this folder to filter and change button to

go /home Select Backup FILTER Copy ZIP TO to="/home\..\DO9\+ Backup +" go "/home\..\DO9\+ Backup +" select "aaa.zip" rename "aaa.zip" to="DO_USB_Backup_{date|yyyy-MM-dd}.obk" AUTORENAME

second strange thing... "aaa" and "buttons" are not display in obk again. but if i rename manually obk file to zip and open it. or refresh with F5, "buttons" folder appear.

Using lots of go/select/copy/rename commands at once is asking for trouble, since Opus commands aren't like batch files (they all run within the context of the starting folder and file selection and often won't do what you expect if you change folders and the selection as part of the button).

In theory you can do all of this in a single Copy line, though. You can call the Copy, specify the path you want to zip up, also specify the filter to use, and give the dated zip file name as the destination.

I haven't tried it (gotta have a shower and head out soon) so there may be some complications but in theory it's a one-liner.

ok, i know... but i try... :cry:

but try this :

  • create 3 folders "one", "two" and three"
  • add filter "test" to select all 3 folders
  • create button

select test filter Copy ZIP here
now open zip file and you can see that the first selected folder are missing.

if you select manually folders and clic button "Copy ZIP here", it's ok.

PS: i notice that i my first post i make an error in button Copy ZIP TO to="/home..\DO9+ Backup +"

You're still mixing Select and Copy which isn't a good idea. If you have a filter defined, let's say it's called MyFilter, then you can specify it as part of the copy command:

Copy FILTER=MyFilter ZIP HERE

Or something like that.

i use select and copy command because
copy filter=test
don't work :cry:

I used the filter shown below and a button that runs Copy FILTER=Test to get the results shown below as well. (Source was on the left, results on the right, both in Flat View so you can see inside the directories.)

The Name clause picks up the files in the top level that I want, so in your example you'd want a Name clause matching this:

userdata.omd|dopus.cert

The Location clause picks up the wanted folders in the top level, so in your example you'd want a Location clause matching this:

(buttons|collections|configfiles|filetypes|filters|formats|global data|icons|images|layouts|listerstyles|logs|program state|rename presets|state data|tabgroups|themes|tools|usercommands)

Combine them both via an "or" and the filter should match everything you want to include.

Note that the button still requires you to select everything that you want it to consider copying. You could probably expand on that by specifying the source directory so that it can be run from anywhere, without selecting anything first.




many thanks nudel...
i wrote this before holidays and i've forgot it. :smiley:

i have reduce my button code...

Go /home Select FILTER="Backup" Copy ZIP TO="/home\..\DO9\+ Backup +\" CREATEFOLDER="DO_USB_Backup_{date|yyyy-MM-dd}_{time|HHmmss}.obk" Go "/home\..\DO9\+ Backup +"
Zip folder are now named directly (notice that CREATEFOLDER are not in the arguments list of Copy commands).
But i have serious problem with filter. i create this simple filter and try to select files with it...

files are selected but no folders. i don't understand :cry:

You're still mixing Select and Copy which isn't a good idea. If you have a filter defined, let's say it's called MyFilter, then you can specify it as part of the copy command:

Copy FILTER=MyFilter ZIP HERE

Or something like that.