<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
<section id="JCR.BackupClient">
  <title>Backup console binary distribution</title>

  <section id="JCR.BackupClient.Introduction">
    <title>Introduction</title>

    <para>The backup console binary distribution is script-based front-end to
    backup client to creation backup, restore, getting status of current or
    completed backup/restore, etc.</para>

    <para>The backup console binary distribution conatins original backup
    console and script adaptation for use with GateIn based products like
    Platform.</para>
  </section>

  <section id="JCR.BackupClient.jcrbackup.cmdAndjcrbackup.sh">
    <title>jcrbackup.cmd and jcrbackup.sh</title>

    <para>These scripts suitable for Standalone and flexible for various
    authentication ways shell scripts.</para>

    <para>Command signature:</para>

    <programlisting>           &lt;url_basic_authentication&gt; | &lt;url_form_authentication&gt;  &lt;command&gt; 

           &lt;url_basic_authentication&gt;:  http(s)//login:password@host:port/&lt;context&gt; 
           &lt;url_form_authentication&gt; :  http(s)//host:port/&lt;context&gt; &lt;form_auth_parm&gt; 

           &lt;form_auth_part&gt;          :  form &lt;method&gt; &lt;form_path&gt;
           &lt;method&gt;                  :  POST or GET
           &lt;form_path&gt;               :  /path/path?&lt;paramName1&gt;=&lt;paramValue1&gt;&amp;&lt;paramName2&gt;=&lt;paramValue2&gt;...

           Example of &lt;url_form_authentication&gt; - http://127.0.0.1:8080/portal/rest form POST "/portal/login?initialURI=/portal/private&amp;username=root&amp;password=gtn"

           &lt;command&gt;                 :  start &lt;repo[/ws]&gt; &lt;backup_dir&gt; [&lt;incr&gt;] 
                                        stop &lt;backup_id&gt;
                                        status &lt;backup_id&gt;
                                        restores &lt;repo[/ws]&gt;
                                        restore [remove-exists] {{&lt;backup_id&gt;|&lt;backup_set_path&gt;} | {&lt;repo[/ws]&gt; {&lt;backup_id&gt;|&lt;backup_set_path&gt;} [&lt;pathToConfigFile&gt;]}}
                                        list [completed]
                                        info
                                        drop [force-close-session] &lt;repo[/ws]&gt;
                                        help

           start                     :  start backup of repository or workspace
           stop                      :  stop backup
           status                    :  information about the current or completed backup by 'backup_id'
           restores                  :  information about the last restore on specific repository or workspace
           restore                   :  restore the repository or workspace from specific backup
           list                      :  information about the current backups (in progress)
           list completed            :  information about the completed (ready to restore) backups
           info                      :  information about the service backup
           drop                      :  delete the repository or workspace
           help                      :  print help information about backup console

           &lt;repo[/ws]&gt;               :  /&lt;repository-name&gt;[/&lt;workspace-name&gt;]  the repository or workspace
           &lt;backup_dir&gt;              :  path to folder for backup on remote server
           &lt;backup_id&gt;               :  the identifier for backup
           &lt;incr&gt;                    :  incremental job period
           &lt;pathToConfigFile&gt;        :  path (local) to  repository or workspace configuration
           remove-exists             :  remove fully (db, value storage, index) exists repository/workspace
           force-close-session       :  close opened sessions on repository or workspace

  
           All valid combination of parameters for command restore: 
            1. restore remove-exists &lt;repo/ws&gt; &lt;backup_id&gt;       &lt;pathToConfigFile&gt; 
            2. restore remove-exists &lt;repo&gt;    &lt;backup_id&gt;       &lt;pathToConfigFile&gt; 
            3. restore remove-exists &lt;repo/ws&gt; &lt;backup_set_path&gt; &lt;pathToConfigFile&gt; 
            4. restore remove-exists &lt;repo&gt;    &lt;backup_set_path&gt; &lt;pathToConfigFile&gt; 
            5. restore remove-exists &lt;backup_id&gt; 
            6. restore remove-exists &lt;backup_set_path&gt; 
            7. restore &lt;repo/ws&gt; &lt;backup_id&gt;       &lt;pathToConfigFile&gt; 
            8. restore &lt;repo&gt;    &lt;backup_id&gt;       &lt;pathToConfigFile&gt; 
            9. restore &lt;repo/ws&gt; &lt;backup_set_path&gt; &lt;pathToConfigFile&gt; 
           10. restore &lt;repo&gt;    &lt;backup_set_path&gt; &lt;pathToConfigFile&gt; 
           11. restore &lt;backup_id&gt; 
           12. restore &lt;backup_set_path&gt; 
</programlisting>
  </section>

  <section id="JCR.BackupClient.exobackup.shAndexobackup.cmd">
    <title>exobackup.sh and exobackup.cmd</title>

    <para>These scripts suitable for use with GateIn based products like
    Platform</para>

    <para>Command signature:</para>

    <programlisting>           -u &lt;user&gt; -p &lt;password&gt; [form_of_authentication] &lt;host:port&gt; &lt;command&gt;

           &lt;form_of_authentication&gt;  :  -b - is used for basic authentication
                                        -f [-c &lt;context&gt;] - is used for form authentication with context portal if parameter context not specified 
                                        if no authentication set basic authentication is used
           -c &lt;context&gt;              :  context, by default context is portal

           &lt;command&gt;                 :  start &lt;repo[/ws]&gt; &lt;backup_dir&gt; [&lt;incr&gt;] 
                                        stop &lt;backup_id&gt;
                                        status &lt;backup_id&gt;
                                        restores &lt;repo[/ws]&gt;
                                        restore [remove-exists] {{&lt;backup_id&gt;|&lt;backup_set_path&gt;} | {&lt;repo[/ws]&gt; {&lt;backup_id&gt;|&lt;backup_set_path&gt;} [&lt;pathToConfigFile&gt;]}}
                                        list [completed]
                                        info
                                        drop [force-close-session] &lt;repo[/ws]&gt;
                                        help

           start                     :  start backup of repository or workspace
           stop                      :  stop backup
           status                    :  information about the current or completed backup by 'backup_id'
           restores                  :  information about the last restore on specific repository or workspace
           restore                   :  restore the repository or workspace from specific backup
           list                      :  information about the current backups (in progress)
           list completed            :  information about the completed (ready to restore) backups
           info                      :  information about the service backup
           drop                      :  delete the repository or workspace
           help                      :  print help information about backup console

           &lt;repo[/ws]&gt;               :  /&lt;repository-name&gt;[/&lt;workspace-name&gt;]  the repository or workspace
           &lt;backup_dir&gt;              :  path to folder for backup on remote server
           &lt;backup_id&gt;               :  the identifier for backup
           &lt;incr&gt;                    :  incremental job period
           &lt;pathToConfigFile&gt;        :  path (local) to  repository or workspace configuration
           remove-exists             :  remove fully (db, value storage, index) exists repository/workspace
           force-close-session       :  close opened sessions on repository or workspace


           All valid combination of parameters for command restore: 
            1. restore remove-exists &lt;repo/ws&gt; &lt;backup_id&gt;       &lt;pathToConfigFile&gt; 
            2. restore remove-exists &lt;repo&gt;    &lt;backup_id&gt;       &lt;pathToConfigFile&gt; 
            3. restore remove-exists &lt;repo/ws&gt; &lt;backup_set_path&gt; &lt;pathToConfigFile&gt; 
            4. restore remove-exists &lt;repo&gt;    &lt;backup_set_path&gt; &lt;pathToConfigFile&gt; 
            5. restore remove-exists &lt;backup_id&gt; 
            6. restore remove-exists &lt;backup_set_path&gt; 
            7. restore &lt;repo/ws&gt; &lt;backup_id&gt;       &lt;pathToConfigFile&gt; 
            8. restore &lt;repo&gt;    &lt;backup_id&gt;       &lt;pathToConfigFile&gt; 
            9. restore &lt;repo/ws&gt; &lt;backup_set_path&gt; &lt;pathToConfigFile&gt; 
           10. restore &lt;repo&gt;    &lt;backup_set_path&gt; &lt;pathToConfigFile&gt; 
           11. restore &lt;backup_id&gt; 
           12. restore &lt;backup_set_path&gt; </programlisting>
  </section>

  <section id="JCR.BackupClient.BackupConsoleBinaryDistributionUsage">
    <title>Backup console binary distribution usage</title>

    <section id="JCR.BackupClient.BackupConsoleBinaryDistributionUsage.BuildingApplication">
      <title>Building application</title>

      <itemizedlist>
        <listitem>
          <para>Go to folder <emphasis
          role="bold">${JCR-SRC-HOME}/applications/exo.jcr.applications.backupconsole.dist</emphasis>
          . - build the application :<programlisting>mvn clean install</programlisting></para>
        </listitem>
      </itemizedlist>
    </section>

    <section id="JCR.BackupClient.BackupConsoleBinaryDistributionUsage.GettingInformationAboutBackupService">
      <title>Getting information about backup service</title>

      <para>The context is "portal" by default for FORM authentiaction.</para>

      <programlisting>./exobackup.sh -u root -p gtn -f 192.168.0.15:8080 info</programlisting>

      <para>Return :</para>

      <programlisting>The backup service information : 
  full backup type               : org.exoplatform.services.jcr.ext.backup.impl.fs.FullBackupJob
  incremetal backup type         : org.exoplatform.services.jcr.ext.backup.impl.fs.IncrementalBackupJob
  backup log folder              : /home/rainf0x/java/exo-working/JCR-839/new_JCR/exo-tomcat/bin/../temp/backup
  default incremental job period : 3600</programlisting>
    </section>

    <section id="JCR.BackupClient.BackupConsoleBinaryDistributionUsage.GettingInformationAboutBackupServiceWithUseNotDefaultContext">
      <title>Getting information about backup service with use not default
      context</title>

      <para>The context is "exodms-demo".</para>

      <programlisting>./exobackup.sh -u root -p gtn -f -c exodms-demo 192.168.0.15:8080 info</programlisting>

      <para>Return :</para>

      <programlisting>The backup service information : 
  full backup type               : org.exoplatform.services.jcr.ext.backup.impl.fs.FullBackupJob
  incremetal backup type         : org.exoplatform.services.jcr.ext.backup.impl.fs.IncrementalBackupJob
  backup log folder              : /home/rainf0x/java/exo-working/JCR-839/new_JCR/exo-tomcat/bin/../temp/backup
  default incremental job period : 3600</programlisting>
    </section>
  </section>
</section>
