<?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: Simple find command in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/simple-find-command/m-p/3695227#M67422</link>
    <description>Hey guys,&lt;BR /&gt;&lt;BR /&gt;Thanks for the help, I am more of a HP-UX guy than a linux person.  At any rate I finally got it working.  For some reason I had to start and stop cron in order to get the log file to be created and the script worked. (0 byte logfile) I decided to stop logging the job and the thing quit working so I stopped and started cron again and the job worked again.  So it seems that any time I make any changes to my cron jobs I have to restart crond.  Something I never have to do in HP-UX.  Or maybe my Linux server is flakey?&lt;BR /&gt;&lt;BR /&gt;Once again thanks for your help&lt;BR /&gt;And Happy New Years to All.&lt;BR /&gt;&lt;BR /&gt;Paul</description>
    <pubDate>Fri, 30 Dec 2005 14:39:13 GMT</pubDate>
    <dc:creator>Paul Sperry</dc:creator>
    <dc:date>2005-12-30T14:39:13Z</dc:date>
    <item>
      <title>Simple find command</title>
      <link>https://community.hpe.com/t5/operating-system-linux/simple-find-command/m-p/3695219#M67414</link>
      <description>Greetings all,&lt;BR /&gt;&lt;BR /&gt;I have a simple script to copy oracle dumps&lt;BR /&gt;across a nfs mount to another server that is offsite.  Here is is.&lt;BR /&gt;&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;DATE=$(date +%m%d)0700&lt;BR /&gt;touch -t $DATE /tmp/reffile&lt;BR /&gt;find /usr/local/dumps -type f -name *.gz -newer /tmp/reffile -exec cp {} /offsite_mnt \;&lt;BR /&gt;sleep 5&lt;BR /&gt;rm -f /tmp/reffile&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;The find command is all on one line.&lt;BR /&gt;In the actual script I use full paths for all commands.  but when I run it It comes back with:&lt;BR /&gt;&lt;BR /&gt;/usr/bin/find: paths must precede expression&lt;BR /&gt;Usage: /usr/bin/find [path...] [expression]&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Any Ideas ?  I am loosing hair over this.&lt;BR /&gt;&lt;BR /&gt;TIA&lt;BR /&gt;Paul&lt;BR /&gt;</description>
      <pubDate>Tue, 20 Dec 2005 12:57:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/simple-find-command/m-p/3695219#M67414</guid>
      <dc:creator>Paul Sperry</dc:creator>
      <dc:date>2005-12-20T12:57:46Z</dc:date>
    </item>
    <item>
      <title>Re: Simple find command</title>
      <link>https://community.hpe.com/t5/operating-system-linux/simple-find-command/m-p/3695220#M67415</link>
      <description>I put double quotes around the wildcard ("*.gz") and I also put the -name before the -type&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 20 Dec 2005 13:03:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/simple-find-command/m-p/3695220#M67415</guid>
      <dc:creator>Rick Garland</dc:creator>
      <dc:date>2005-12-20T13:03:55Z</dc:date>
    </item>
    <item>
      <title>Re: Simple find command</title>
      <link>https://community.hpe.com/t5/operating-system-linux/simple-find-command/m-p/3695221#M67416</link>
      <description>Thanks Rick that did it.&lt;BR /&gt;I guess linux find is slightly different than HP-UX.  Thanks again and happy hollidays</description>
      <pubDate>Tue, 20 Dec 2005 13:13:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/simple-find-command/m-p/3695221#M67416</guid>
      <dc:creator>Paul Sperry</dc:creator>
      <dc:date>2005-12-20T13:13:17Z</dc:date>
    </item>
    <item>
      <title>Re: Simple find command</title>
      <link>https://community.hpe.com/t5/operating-system-linux/simple-find-command/m-p/3695222#M67417</link>
      <description>The -name test takes only one argument.  In your command line, the shell is expanding the *s* into more than one argument before the find command is run.&lt;BR /&gt;&lt;BR /&gt;Therefore you get the error you see.  You should either escape any shell metacharacters in the -name argument or enclose that argument in quotes.</description>
      <pubDate>Tue, 20 Dec 2005 13:19:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/simple-find-command/m-p/3695222#M67417</guid>
      <dc:creator>Ivan Ferreira</dc:creator>
      <dc:date>2005-12-20T13:19:40Z</dc:date>
    </item>
    <item>
      <title>Re: Simple find command</title>
      <link>https://community.hpe.com/t5/operating-system-linux/simple-find-command/m-p/3695223#M67418</link>
      <description>Ivan,&lt;BR /&gt;&lt;BR /&gt;Thanks for the clearification.&lt;BR /&gt;Happy Hollidays&lt;BR /&gt;&lt;BR /&gt;Paul</description>
      <pubDate>Tue, 20 Dec 2005 13:24:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/simple-find-command/m-p/3695223#M67418</guid>
      <dc:creator>Paul Sperry</dc:creator>
      <dc:date>2005-12-20T13:24:59Z</dc:date>
    </item>
    <item>
      <title>Re: Simple find command</title>
      <link>https://community.hpe.com/t5/operating-system-linux/simple-find-command/m-p/3695224#M67419</link>
      <description>Hey all,&lt;BR /&gt;&lt;BR /&gt;Well the script works fine when I run it from the command line.  But when I try to schedual it in cron it doesn't work.  No clues in the cron log or messages file.&lt;BR /&gt;the cron log shows it runs for 6 seconds&lt;BR /&gt;(sleep 5 + 1 sec) so my guess is the find is not working.  Any ideas&lt;BR /&gt;&lt;BR /&gt;TIA&lt;BR /&gt;Paul</description>
      <pubDate>Thu, 29 Dec 2005 15:15:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/simple-find-command/m-p/3695224#M67419</guid>
      <dc:creator>Paul Sperry</dc:creator>
      <dc:date>2005-12-29T15:15:05Z</dc:date>
    </item>
    <item>
      <title>Re: Simple find command</title>
      <link>https://community.hpe.com/t5/operating-system-linux/simple-find-command/m-p/3695225#M67420</link>
      <description>you didn't provide us the crontab file,&lt;BR /&gt;anyway I suggest you to provide the full path of an executable in crontab.This executable would be a bash script with one command.In your case the find command.If it works-great!Otherwise try other simpler commands like "touch /tmp/filename". Isolate the problem in other words...&lt;BR /&gt;Hope it helps.</description>
      <pubDate>Thu, 29 Dec 2005 16:03:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/simple-find-command/m-p/3695225#M67420</guid>
      <dc:creator>Alexander Chuzhoy</dc:creator>
      <dc:date>2005-12-29T16:03:29Z</dc:date>
    </item>
    <item>
      <title>Re: Simple find command</title>
      <link>https://community.hpe.com/t5/operating-system-linux/simple-find-command/m-p/3695226#M67421</link>
      <description>Cron jobs reports any errors that went to stdout and stderr by mail. You can configure in the crontab file the variable MAILTO= to indicate who should receive the mail, by default is the user.&lt;BR /&gt;&lt;BR /&gt;Another way to debug is to redirect the ouput of the command to a log file, if this script is called clean.bash, configure your cron to run to something like this:&lt;BR /&gt;&lt;BR /&gt;5 * * * * /usr/local/sbin/clean.bash &amp;gt; /var/log/clean.log 2&amp;gt;&amp;amp;1</description>
      <pubDate>Fri, 30 Dec 2005 07:11:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/simple-find-command/m-p/3695226#M67421</guid>
      <dc:creator>Ivan Ferreira</dc:creator>
      <dc:date>2005-12-30T07:11:08Z</dc:date>
    </item>
    <item>
      <title>Re: Simple find command</title>
      <link>https://community.hpe.com/t5/operating-system-linux/simple-find-command/m-p/3695227#M67422</link>
      <description>Hey guys,&lt;BR /&gt;&lt;BR /&gt;Thanks for the help, I am more of a HP-UX guy than a linux person.  At any rate I finally got it working.  For some reason I had to start and stop cron in order to get the log file to be created and the script worked. (0 byte logfile) I decided to stop logging the job and the thing quit working so I stopped and started cron again and the job worked again.  So it seems that any time I make any changes to my cron jobs I have to restart crond.  Something I never have to do in HP-UX.  Or maybe my Linux server is flakey?&lt;BR /&gt;&lt;BR /&gt;Once again thanks for your help&lt;BR /&gt;And Happy New Years to All.&lt;BR /&gt;&lt;BR /&gt;Paul</description>
      <pubDate>Fri, 30 Dec 2005 14:39:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/simple-find-command/m-p/3695227#M67422</guid>
      <dc:creator>Paul Sperry</dc:creator>
      <dc:date>2005-12-30T14:39:13Z</dc:date>
    </item>
    <item>
      <title>Re: Simple find command</title>
      <link>https://community.hpe.com/t5/operating-system-linux/simple-find-command/m-p/3695228#M67423</link>
      <description>I can warranty that you don't have to restart cron at any modifications. Are you editing using crontab -e? Do not edit directly the file in /var/spool/cron.&lt;BR /&gt;&lt;BR /&gt;You only need to restart cron when you clean the cron log file (/var/log/cron), so cron can write to the file again.</description>
      <pubDate>Fri, 30 Dec 2005 14:52:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/simple-find-command/m-p/3695228#M67423</guid>
      <dc:creator>Ivan Ferreira</dc:creator>
      <dc:date>2005-12-30T14:52:24Z</dc:date>
    </item>
    <item>
      <title>Re: Simple find command</title>
      <link>https://community.hpe.com/t5/operating-system-linux/simple-find-command/m-p/3695229#M67424</link>
      <description>Ivan,&lt;BR /&gt;&lt;BR /&gt;Yes I was using crontab -e to edit my cron jobs.  But honestly any time I changed my job it quit working untill I restarted crond.&lt;BR /&gt;Makes no sence to me but I am glad to hear this isn't a "normal" thing to have to do.&lt;BR /&gt;Perhaps I am behind on patches.  We are mostly a HP-UX and windows operation but are favoring Linux over Windows for any new servers.&lt;BR /&gt;&lt;BR /&gt;Thanks again&lt;BR /&gt;Happy New Years To All&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Paul</description>
      <pubDate>Fri, 30 Dec 2005 15:09:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/simple-find-command/m-p/3695229#M67424</guid>
      <dc:creator>Paul Sperry</dc:creator>
      <dc:date>2005-12-30T15:09:11Z</dc:date>
    </item>
    <item>
      <title>Re: Simple find command</title>
      <link>https://community.hpe.com/t5/operating-system-linux/simple-find-command/m-p/3695230#M67425</link>
      <description>Try as,&lt;BR /&gt;&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;&lt;BR /&gt;# Script&lt;BR /&gt;touch -t $(date +%m%d)0700 /tmp/reffile&lt;BR /&gt;&lt;BR /&gt;# Will go to cron log&lt;BR /&gt;echo "Operation is Started :)"&lt;BR /&gt;&lt;BR /&gt;for file in `find /usr/local/dumps -name "*.gz" -type f -newer /tmp/reffile`&lt;BR /&gt;do&lt;BR /&gt;  cp ${file} /offsite_mnt;&lt;BR /&gt;done&lt;BR /&gt;sleep 1&lt;BR /&gt;rm -f /tmp/reffile&lt;BR /&gt;&lt;BR /&gt;# Will go to cron log&lt;BR /&gt;echo "Operation is completed :)"&lt;BR /&gt;&lt;BR /&gt;#END&lt;BR /&gt;exit 0&lt;BR /&gt;&lt;BR /&gt;Edit crontab -e as,&lt;BR /&gt;5 * * * * path to script&lt;BR /&gt;&lt;BR /&gt;and monitor cron log and post the result.&lt;BR /&gt;&lt;BR /&gt;-Muthu</description>
      <pubDate>Mon, 02 Jan 2006 04:18:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/simple-find-command/m-p/3695230#M67425</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2006-01-02T04:18:14Z</dc:date>
    </item>
  </channel>
</rss>

