1 Reply Latest reply: Jun 20, 2012 3:05 PM by Andy Klock RSS

    How to redirect CELLCLI output to text file

    Yoav
      Hi,
      I would like to redicrect the output of the cellcli command to a text file .
      For example , how to redirect the output of this command to a text file on /tmp
      CellCLI> list metrichistory where objectType = 'CELL' -
      
      
      and name = 'CL_TEMP'
      Thanks
        • 1. Re: How to redirect CELLCLI output to text file
          Andy Klock
          cellcli has spooling capabilities similar to sqlplus:
          CellCLI> help spool
          
            Usage:  SPO[OL] [<filename> [ CRE[ATE] | REP[LACE] | APP[END]] | OFF ]
          
            Purpose: SPOOL <filename>: Direct the results to the file <filename>.
                     SPOOL OFF: Turn off the spooling.
                     SPOOL: Check the current spooling status.
          
            Arguments:
              <filename>: The filename where the results will be output.
          
            Options:
              [APPEND]: If the filename already exists, the following output will
                        be appended to the file. Without this option, the existing file
                        contents will be replaced.
              [CREATE]: If the filename already exists, an error is reported.
              [REPLACE]: If the filename already exists, the contents will be
                        replaced.  This is the default, when no option is provided.
          
            Examples:
              spool myfile
              spool myfile append
              spool off
              spool
          But if you are trying to script it, it would be easier to just run it command line:
          # cellcli -e "list metrichistory where objectType = 'CELL' and name = 'CL_TEMP'" > /tmp/CL_TEMP.txt
          Also look into dcli which allows you to run cellcli commands on one or more cells from a compute node.

          Good luck.