Copy sessions via cli
I need to copy for example 5 sessions to one medium from command line, how it should look. Is it posible to do copy of several sessions at one time.
Re: Copy sessions via cli
There are different type of 'Copy' operations,
- 'omnimcopy' is pretty much a dumb copy from one media to another
- 'omniobjcopy' lets you copy from individual sessions
It will be much easier if you can create the Object Copy in the GUI, and save it as a filename, because trying to run the entire Object Copy from the command line is very difficult, and can be prone to syntax errors
If you are able to create the Object Copy in the GUI, then, to run it from the command line:
omniobjcopy -copylist "[name]" -scheduled for a scheduled Object Copy
omniobjcopy -copylist "[name}" -postbackup -session [session_id] Do not include the [ ] marks
where [name] is the name of the Copy List, and the " marks are required if the Copylist name has any 'spaces' in it
If you don't have the Object Copy created, the task becomes much more complex
omniobjcopy [Object Name] -session [session_id] -sourcedevice [logical_Device] -targetdevice [logical device]
-dynamic [min] [max] -targetprotect [protection level]
and the list of options goes on and on. I would encourage you to check the Command Line Guide, which you can find by, in the GUI, click Help -> Guides, and look for 'Command Line Interface Reference' (you will need to have Adobe Acrobat installed to view the Guides, expand 'Section 1' and click on 'omniobjcopy'
Probably the place where you wil have the most trouble is in defining the Object name. You can get the session ID of the backup session and run
omnidb -session [session_id] -detail
This type of Object Copy has to be done on an Object by Object level, and on a Session by Session basis. The documentation seems to suggest that you can combine several different objects and sessions into one Object Copy operation
omniobjcopy -winfs system.company.com:/C 'Object1' -session
2011/04/01-3 -targetdevice 'DEV1' -recycle -winfs
systems.company.com:/C 'Object2' -session 2011/04/25-9 -targetdevice
or, splitting it for clarity
-winfs system.company.com:/C 'Object1' -session 2011/04/01-3 -targetdevice 'DEV1' -recycle
-winfs systems.company.com:/C 'Object2' -session 2011/04/25-9 -targetdevice 'DEV1'
Re: Copy sessions via cli
That is correct, I would recommend that the script be assembled and tested in pieces, rather t5han trying to write the entire script in one sitting
One thing to be conscious of when writing a command or a script it the format fo the Object part. The Object name consists of
and this depends very much on what type of system was backed up, in terms of a file system backup. If it was a UNIX-based system, the type of Object is 'filesystem' so the Object would look like
-filesystem hostname:mountpoint 'descriptor'
so, for example
-filesystem mysys.hp.com:/tmp 'Monday tmp'
while, if the Object was Windows, it would look like
-winfs mysys.hp.com:/D "Monday D-drive"
Notice that when doing an Object Copy of UNIX, single quotes are used, but an Object name of a Windows Copy needs double-quotes
This is where the output from 'omnidb -session -detail' can really help you