<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.1.2//EN"
  "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">


<refentry id="gfncopy.1">

<refentryinfo><date>15 Jul 2020</date></refentryinfo>

<refmeta>
<refentrytitle>gfncopy</refentrytitle>
<manvolnum>1</manvolnum>
<refmiscinfo>Gfarm</refmiscinfo>
</refmeta>

<refnamediv id="name">
<refname>gfncopy</refname>
<refpurpose>Manipulate number of file replicas automatically created</refpurpose>
</refnamediv>

<refsynopsisdiv id="synopsis">
<cmdsynopsis sepchar=" ">
  <command moreinfo="none">gfncopy</command>
    <arg choice="opt" rep="norepeat">-vh</arg>
    <arg choice="plain" rep="norepeat"><replaceable>path</replaceable></arg>
</cmdsynopsis>

<cmdsynopsis sepchar=" ">
  <command moreinfo="none">gfncopy</command>
    <arg choice="opt" rep="norepeat">-vh</arg>
    <group choice="opt" rep="norepeat">
      <arg choice="plain" rep="norepeat">-C</arg>
      <arg choice="plain" rep="norepeat">-M</arg>
    </group>
    <arg choice="plain" rep="norepeat">-s <replaceable>NCOPY</replaceable></arg>
    <arg choice="plain" rep="norepeat"><replaceable>path</replaceable></arg>
</cmdsynopsis>

<cmdsynopsis sepchar=" ">
  <command moreinfo="none">gfncopy</command>
    <arg choice="opt" rep="norepeat">-vh</arg>
    <group choice="opt" rep="norepeat">
      <arg choice="plain" rep="norepeat">-C</arg>
      <arg choice="plain" rep="norepeat">-M</arg>
    </group>
    <arg choice="plain" rep="norepeat">-S <replaceable>REPATTR</replaceable></arg>
    <arg choice="plain" rep="norepeat"><replaceable>path</replaceable></arg>
</cmdsynopsis>

<cmdsynopsis sepchar=" ">
  <command moreinfo="none">gfncopy</command>
    <arg choice="opt" rep="norepeat">-vh</arg>
    <arg choice="plain" rep="norepeat">-r</arg>
    <arg choice="plain" rep="norepeat"><replaceable>path</replaceable></arg>
    <arg choice="opt" rep="repeat"><replaceable>path</replaceable></arg>
</cmdsynopsis>

<cmdsynopsis sepchar=" ">
  <command moreinfo="none">gfncopy</command>
    <arg choice="opt" rep="norepeat">-vh</arg>
    <arg choice="plain" rep="norepeat">-c</arg>
    <arg choice="plain" rep="norepeat"><replaceable>path</replaceable></arg>
</cmdsynopsis>

<cmdsynopsis sepchar=" ">
  <command moreinfo="none">gfncopy</command>
    <arg choice="opt" rep="norepeat">-v</arg>
    <arg choice="plain" rep="norepeat">-w</arg>
    <arg choice="opt" rep="norepeat">-t <replaceable>TIMEOUT</replaceable></arg>
    <arg choice="plain" rep="norepeat"><replaceable>path</replaceable></arg>
    <arg choice="opt" rep="repeat"><replaceable>path</replaceable></arg>
</cmdsynopsis>

</refsynopsisdiv>

<refsect1 id="description"><title>DESCRIPTION</title>
<para>gfncopy manipulates the number of file replicas automatically
created.  When no option is specified, it displays the specified
number of file replicas.  When replication attributes of both NCOPY
and REPATTR are set to a file, these attributes are displayed in two
lines.  With the <option>-v</option> option, it also displays path
names up to the ancient directory that specifies the number of file
repilcas.
</para>

</refsect1>

<refsect1 id="options"><title>OPTIONS</title>
<variablelist>

<varlistentry>
<term><option>-s</option> <parameter moreinfo="none">NCOPY</parameter></term>
<listitem>
<para>specifies the attribute for automatic replication represented by
the number of file replicas to a file or directory.
<parameter moreinfo="none">NCOPY</parameter> is stored in the extended
attribute of gfarm.ncopy.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term><option>-S</option> <parameter moreinfo="none">REPATTR</parameter></term>
<listitem>
<para>specifies the attribute for automatic replication represented by
host groups to a file or directory.</para>

<para>
When both <parameter moreinfo="none">NCOPY</parameter>
and <parameter moreinfo="none">REPATTR</parameter> are set to a same file,
the following number of replicas will be created.
If N is the total number of replicas specified by REPATTR,
and N is greater than NCOPY, at least N replicas will be created.
Otherwise, replicas will be created according to REPATTR,
and more replicas will be added until total number of replicas reaches NCOPY.
<parameter moreinfo="none">REPATTR</parameter> is stored in the extended
attribute of gfarm.replicainfo.
</para>
<para>
a <parameter moreinfo="none">REPATTR</parameter> is represented by the following BNF:
</para>
<literallayout format="linespecific" class="normal">
    &lt;repattr&gt; ::= &lt;an_attr&gt; | &lt;an_attr&gt; ',' &lt;repattr&gt;
    &lt;an_attr&gt; ::= &lt;host_group&gt; ':' &lt;num_rep&gt;
    &lt;host_group&gt; ::= &lt;string&gt;
    &lt;num_rep&gt; ::= &lt;integer&gt;

  e.g.)
    group0:2
    group0:1,group1:2,group2:3
</literallayout>
</listitem>
</varlistentry>

<varlistentry>
<term><option>-C</option></term>
<listitem>
<para>
If the replication attribute exists already on the
file, <command moreinfo="none">gfncopy</command> with the <option>-s</option>
or <option>-S</option> options fails.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><option>-M</option></term>
<listitem>
<para>
If the replication attribute does not exist on the
file, <command moreinfo="none">gfncopy</command> with the <option>-s</option>
or <option>-S</option> options fails.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><option>-r</option></term>
<listitem>
<para>removes the specified replication attributes.</para>
<para>
The <replaceable>path</replaceable> can be specified multiple times.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term><option>-c</option></term>
<listitem>
<para>displays the number of file repicas the file really has.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><option>-w</option></term>
<listitem>
<para>checks whether or not the file replicas have been created
according to the replication attributes (NCOPY or REPATTR), otherwise
waits for the completion of the replication.</para>
<para>
The <replaceable>path</replaceable> can be specified multiple times.
</para>
<para>
If the <replaceable>path</replaceable> is a directory, files in
subdirectories are checked.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term><option>-t</option> <parameter moreinfo="none">TIMEOUT</parameter></term>
<listitem>
<para>
specifies the time in seconds for the <option>-w</option> option to
wait until automatic replication starts.
Timeout does not occur while the replication is running.
Default is 30 seconds.
</para>
</listitem>
</varlistentry>

<varlistentry>
<term><option>-h</option></term>
<listitem>
<para>processes symbolic link instead of any referenced files.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><option>-v</option></term>
<listitem>
<para>displays verbose messages.</para>
</listitem>
</varlistentry>

<varlistentry>
<term><option>-?</option></term>
<listitem>
<para>displays a list of command options.</para>
</listitem>
</varlistentry>

</variablelist>
</refsect1>

<refsect1 id="see-also"><title>SEE ALSO</title>
<para>
  <citerefentry>
  <refentrytitle>gfhostgroup</refentrytitle><manvolnum>1</manvolnum>
  </citerefentry>,
  <citerefentry>
  <refentrytitle>gfarm_attr</refentrytitle><manvolnum>5</manvolnum>
  </citerefentry>
</para>
</refsect1>

</refentry>

