<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: move log files in linux in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/move-log-files-in-linux/m-p/3693821#M21074</link>
    <description>You forgot to define search path in you command.This is the correct syntax for find:&lt;BR /&gt;find &lt;SEARCH-PATH&gt; &lt;OPTIONS&gt;&lt;BR /&gt;&lt;BR /&gt;If you want to find any logfile entire your linux you have to use the following command:&lt;BR /&gt;&lt;BR /&gt;find / -name '*.log' -print -exec cp {} \;&lt;BR /&gt;&lt;BR /&gt;Also most of the log files located in /var, you can use "/var" instead of "/", but if you have non-standard log files, "/" is a better choise.&lt;BR /&gt;&lt;BR /&gt;Alireza&lt;/OPTIONS&gt;&lt;/SEARCH-PATH&gt;</description>
    <pubDate>Mon, 19 Dec 2005 06:10:52 GMT</pubDate>
    <dc:creator>Delrish</dc:creator>
    <dc:date>2005-12-19T06:10:52Z</dc:date>
    <item>
      <title>move log files in linux</title>
      <link>https://community.hpe.com/t5/operating-system-linux/move-log-files-in-linux/m-p/3693818#M21071</link>
      <description>Helllo All,&lt;BR /&gt;           I am actually trying to move/copy all of the files with extension as '.log' to a different directory.&lt;BR /&gt;Itried using the command "find -name '*.log' -print -exec cp {} \;" But every time i try to run it i get the exception missing destination file.&lt;BR /&gt;can any one of you please help me out I am in immediate need of it Please Please please...</description>
      <pubDate>Mon, 19 Dec 2005 01:10:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/move-log-files-in-linux/m-p/3693818#M21071</guid>
      <dc:creator>suman babu mullangi</dc:creator>
      <dc:date>2005-12-19T01:10:34Z</dc:date>
    </item>
    <item>
      <title>Re: move log files in linux</title>
      <link>https://community.hpe.com/t5/operating-system-linux/move-log-files-in-linux/m-p/3693819#M21072</link>
      <description>this will work:&lt;BR /&gt;find /var -type f -name "*.log" -exec cp {} /tmp/log \;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;where /var is the directory to look in and the destination directory is /tmp/log</description>
      <pubDate>Mon, 19 Dec 2005 02:08:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/move-log-files-in-linux/m-p/3693819#M21072</guid>
      <dc:creator>Alexander Chuzhoy</dc:creator>
      <dc:date>2005-12-19T02:08:44Z</dc:date>
    </item>
    <item>
      <title>Re: move log files in linux</title>
      <link>https://community.hpe.com/t5/operating-system-linux/move-log-files-in-linux/m-p/3693820#M21073</link>
      <description>Wrong syntax on the command of,&lt;BR /&gt;&lt;BR /&gt;find -name '*.log' -print -exec cp {} \;&lt;BR /&gt;&lt;BR /&gt;Use as,&lt;BR /&gt;&lt;BR /&gt;find &lt;DIRECTORY&gt; it is good to to start with /var as,&lt;BR /&gt;&lt;BR /&gt;# find /var -name '*.log' -type f -exec cp {} /tmp/ \;&lt;BR /&gt;# find /var -name '*.log' -type f -exec &amp;gt; {} \;&lt;BR /&gt;&lt;BR /&gt;First will do copy to /tmp directory. Second will remove (&amp;gt;) all contents in that file.&lt;BR /&gt;&lt;BR /&gt;-Muthu&lt;/DIRECTORY&gt;</description>
      <pubDate>Mon, 19 Dec 2005 04:14:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/move-log-files-in-linux/m-p/3693820#M21073</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2005-12-19T04:14:49Z</dc:date>
    </item>
    <item>
      <title>Re: move log files in linux</title>
      <link>https://community.hpe.com/t5/operating-system-linux/move-log-files-in-linux/m-p/3693821#M21074</link>
      <description>You forgot to define search path in you command.This is the correct syntax for find:&lt;BR /&gt;find &lt;SEARCH-PATH&gt; &lt;OPTIONS&gt;&lt;BR /&gt;&lt;BR /&gt;If you want to find any logfile entire your linux you have to use the following command:&lt;BR /&gt;&lt;BR /&gt;find / -name '*.log' -print -exec cp {} \;&lt;BR /&gt;&lt;BR /&gt;Also most of the log files located in /var, you can use "/var" instead of "/", but if you have non-standard log files, "/" is a better choise.&lt;BR /&gt;&lt;BR /&gt;Alireza&lt;/OPTIONS&gt;&lt;/SEARCH-PATH&gt;</description>
      <pubDate>Mon, 19 Dec 2005 06:10:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/move-log-files-in-linux/m-p/3693821#M21074</guid>
      <dc:creator>Delrish</dc:creator>
      <dc:date>2005-12-19T06:10:52Z</dc:date>
    </item>
    <item>
      <title>Re: move log files in linux</title>
      <link>https://community.hpe.com/t5/operating-system-linux/move-log-files-in-linux/m-p/3693822#M21075</link>
      <description>You have two errors:&lt;BR /&gt;&lt;BR /&gt;You have not specified the path to the find command.&lt;BR /&gt;&lt;BR /&gt;You have not specified the destination path to the cp command.&lt;BR /&gt;&lt;BR /&gt;Change to something like this:&lt;BR /&gt;&lt;BR /&gt;find /where/to/start/the/search -name "*.log" -exec cp {} /destination/to/copy/files \;&lt;BR /&gt;&lt;BR /&gt;For example:&lt;BR /&gt;&lt;BR /&gt;find /var/log -name "*.log" -exec cp {} /usr/oldlogs \;</description>
      <pubDate>Mon, 19 Dec 2005 06:38:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/move-log-files-in-linux/m-p/3693822#M21075</guid>
      <dc:creator>Ivan Ferreira</dc:creator>
      <dc:date>2005-12-19T06:38:44Z</dc:date>
    </item>
  </channel>
</rss>

