<?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: error:   find: cannot get 'pwd' in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/error-find-cannot-get-pwd/m-p/3168656#M160922</link>
    <description>The find(1) command issues that messaage if this call fails:&lt;BR /&gt; &lt;BR /&gt;home_fd = open(".", O_RDONLY)&lt;BR /&gt; &lt;BR /&gt;So the effective user calling find(1) cannot open the current working directory for reading.&lt;BR /&gt;  &lt;BR /&gt;From root's crontab you call:&lt;BR /&gt; &lt;BR /&gt;su acadmin -c ...&lt;BR /&gt; &lt;BR /&gt;The script is called as user 'acadmin' with root's HOME directory as working directory. Assuming that no cd(1) is done inside your script, are you sure that 'acadmin' has read permission to this directoty?&lt;BR /&gt; &lt;BR /&gt;Check this:&lt;BR /&gt;# su acadmin -c 'ls ~root'&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Best regards...&lt;BR /&gt;Dietmar.&lt;BR /&gt;</description>
    <pubDate>Wed, 21 Jan 2004 05:53:35 GMT</pubDate>
    <dc:creator>Dietmar Konermann</dc:creator>
    <dc:date>2004-01-21T05:53:35Z</dc:date>
    <item>
      <title>error:   find: cannot get 'pwd'</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/error-find-cannot-get-pwd/m-p/3168647#M160913</link>
      <description>I have wrote this script that at the beginning does a find and deletes the files, but when I check my mail I get an error, and the files are not deleted. All permissions are set, and my variables are correct...&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;find $BACKUP_LOGS_DIR -name archbu.log.* -type f -mtime +7 -exec /bin/rm -f {} ";"&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;##&lt;BR /&gt;## Remove archive backup log files in $BACKUP_DEPOT&lt;BR /&gt;##&lt;BR /&gt;echo ""&lt;BR /&gt;echo "Removing  previous copies of archlogs in $BACKUP_DEPOT..."&lt;BR /&gt;find $BACKUP_DEPOT -name archive_logs.*.bz2 -type f -mtime +7 -exec /bin/rm -f {} ";"&lt;BR /&gt;</description>
      <pubDate>Tue, 20 Jan 2004 10:18:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/error-find-cannot-get-pwd/m-p/3168647#M160913</guid>
      <dc:creator>Ratzie</dc:creator>
      <dc:date>2004-01-20T10:18:27Z</dc:date>
    </item>
    <item>
      <title>Re: error:   find: cannot get 'pwd'</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/error-find-cannot-get-pwd/m-p/3168648#M160914</link>
      <description>Are you sure the variables $BACKUP_LOGS_DIR and $BACKUP_DEPOT are set?  How are you running this script.  If it is being run through cron, you'll need to specifically set variables, paths, etc.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete</description>
      <pubDate>Tue, 20 Jan 2004 10:22:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/error-find-cannot-get-pwd/m-p/3168648#M160914</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2004-01-20T10:22:32Z</dc:date>
    </item>
    <item>
      <title>Re: error:   find: cannot get 'pwd'</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/error-find-cannot-get-pwd/m-p/3168649#M160915</link>
      <description>HI,&lt;BR /&gt;&lt;BR /&gt;May be a stupid question but in what dir do you start this script. &lt;BR /&gt;check pwd before you start/ execute  the script.&lt;BR /&gt;&lt;BR /&gt;Gideon</description>
      <pubDate>Tue, 20 Jan 2004 10:26:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/error-find-cannot-get-pwd/m-p/3168649#M160915</guid>
      <dc:creator>G. Vrijhoeven</dc:creator>
      <dc:date>2004-01-20T10:26:45Z</dc:date>
    </item>
    <item>
      <title>Re: error:   find: cannot get 'pwd'</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/error-find-cannot-get-pwd/m-p/3168650#M160916</link>
      <description>All of your variables are not correct:&lt;BR /&gt;&lt;BR /&gt;Your problem (assuming all else is correct) is here:&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt;-name archbu.log.*&lt;BR /&gt;&lt;BR /&gt;this should be:&lt;BR /&gt;-name 'archbu.log.*'&lt;BR /&gt;&lt;BR /&gt;You need to quote the pattern so that find rather than the shell itself instantiates the wildcarding.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Also replace -f {} ";" with -f {} \;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 20 Jan 2004 10:35:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/error-find-cannot-get-pwd/m-p/3168650#M160916</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2004-01-20T10:35:01Z</dc:date>
    </item>
    <item>
      <title>Re: error:   find: cannot get 'pwd'</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/error-find-cannot-get-pwd/m-p/3168651#M160917</link>
      <description>It is running thru roots crontab...&lt;BR /&gt;&lt;BR /&gt;0 3 * * 6 su  acadmin -c /home/bu/scripts/backup/backup_acdb.sh &amp;gt; /home/bu/log/backup_acdb.log.`date +\%j`&lt;BR /&gt;&lt;BR /&gt;I also set the variables at the beginning of the script...&lt;BR /&gt;BACKUP_DEPOT=/opt/app/oracle/oradata/acdb/db5&lt;BR /&gt;BACKUP_LOGS_DIR=/home/bu/log&lt;BR /&gt;</description>
      <pubDate>Tue, 20 Jan 2004 10:36:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/error-find-cannot-get-pwd/m-p/3168651#M160917</guid>
      <dc:creator>Ratzie</dc:creator>
      <dc:date>2004-01-20T10:36:51Z</dc:date>
    </item>
    <item>
      <title>Re: error:   find: cannot get 'pwd'</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/error-find-cannot-get-pwd/m-p/3168652#M160918</link>
      <description>To avoid spelling errors, always put:&lt;BR /&gt; &lt;BR /&gt;set -u&lt;BR /&gt; &lt;BR /&gt;at the beginning of your script. Then, to actually trace your script, put set -x at the beginning of the script and you'll get a mail message with the trace results. Also, if your script works OK when you run it manually but fails in cron, remember that cron does not login so you don't have the same environment.&lt;BR /&gt; &lt;BR /&gt;Also, it's important to protect any -name expressions so that find will parse the special characters. Put the expression string in single quotes: -name 'archbu.log.*' or -name 'archive_logs.*.bz2'</description>
      <pubDate>Tue, 20 Jan 2004 10:48:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/error-find-cannot-get-pwd/m-p/3168652#M160918</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2004-01-20T10:48:54Z</dc:date>
    </item>
    <item>
      <title>Re: error:   find: cannot get 'pwd'</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/error-find-cannot-get-pwd/m-p/3168653#M160919</link>
      <description>This is the output from the set -u, set -x&lt;BR /&gt;+ find /home/bu/log -name archbu.log.* -type f -mtime +7 -exec /bin/rm -f {} ;&lt;BR /&gt;find: cannot get 'pwd'&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;+ echo&lt;BR /&gt;+ echo Removing  previous copies of archlogs in /opt/app/oracle/oradata/acdb/db5...&lt;BR /&gt;+ find /opt/app/oracle/oradata/acdb/db5 -name archive_logs.*.bz2 -type f -mtime +7 -exec /bin/rm -f {} ;&lt;BR /&gt;find: cannot get 'pwd'&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I am at a loss, I have it working properly on another machine... (same script)</description>
      <pubDate>Tue, 20 Jan 2004 11:11:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/error-find-cannot-get-pwd/m-p/3168653#M160919</guid>
      <dc:creator>Ratzie</dc:creator>
      <dc:date>2004-01-20T11:11:14Z</dc:date>
    </item>
    <item>
      <title>Re: error:   find: cannot get 'pwd'</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/error-find-cannot-get-pwd/m-p/3168654#M160920</link>
      <description>Hi,&lt;BR /&gt;try finishing your find command with  space backslash semicolon, e.g.:&lt;BR /&gt;{} \;&lt;BR /&gt;instead of the qouted semicolon.&lt;BR /&gt;&lt;BR /&gt;regards,&lt;BR /&gt;John K.</description>
      <pubDate>Tue, 20 Jan 2004 11:31:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/error-find-cannot-get-pwd/m-p/3168654#M160920</guid>
      <dc:creator>john korterman</dc:creator>
      <dc:date>2004-01-20T11:31:51Z</dc:date>
    </item>
    <item>
      <title>Re: error:   find: cannot get 'pwd'</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/error-find-cannot-get-pwd/m-p/3168655#M160921</link>
      <description>What you can do is do a '-print' or '-exec echo rm -f {} \;' to see how far the find comes.&lt;BR /&gt;&lt;BR /&gt;The message you get is something that happens when you try to find your path in a directory that is not readable/executable by the user. You say you are root, so in normal cases that's not the case (root bypasses normal security) UNLESS... there is a NFS mounted directory in the path (or perhaps the complete tree). '-xdev' might solve the problem in the first case, otherwise run the script on the NFS server instead of the NFS client.</description>
      <pubDate>Wed, 21 Jan 2004 01:31:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/error-find-cannot-get-pwd/m-p/3168655#M160921</guid>
      <dc:creator>Elmar P. Kolkman</dc:creator>
      <dc:date>2004-01-21T01:31:15Z</dc:date>
    </item>
    <item>
      <title>Re: error:   find: cannot get 'pwd'</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/error-find-cannot-get-pwd/m-p/3168656#M160922</link>
      <description>The find(1) command issues that messaage if this call fails:&lt;BR /&gt; &lt;BR /&gt;home_fd = open(".", O_RDONLY)&lt;BR /&gt; &lt;BR /&gt;So the effective user calling find(1) cannot open the current working directory for reading.&lt;BR /&gt;  &lt;BR /&gt;From root's crontab you call:&lt;BR /&gt; &lt;BR /&gt;su acadmin -c ...&lt;BR /&gt; &lt;BR /&gt;The script is called as user 'acadmin' with root's HOME directory as working directory. Assuming that no cd(1) is done inside your script, are you sure that 'acadmin' has read permission to this directoty?&lt;BR /&gt; &lt;BR /&gt;Check this:&lt;BR /&gt;# su acadmin -c 'ls ~root'&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Best regards...&lt;BR /&gt;Dietmar.&lt;BR /&gt;</description>
      <pubDate>Wed, 21 Jan 2004 05:53:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/error-find-cannot-get-pwd/m-p/3168656#M160922</guid>
      <dc:creator>Dietmar Konermann</dc:creator>
      <dc:date>2004-01-21T05:53:35Z</dc:date>
    </item>
    <item>
      <title>Re: error:   find: cannot get 'pwd'</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/error-find-cannot-get-pwd/m-p/3168657#M160923</link>
      <description>In order to correct the problem I cd to the variable first, then did a find.&lt;BR /&gt;&lt;BR /&gt;I think you are right, it may be a permissions problem, the script works perfectly on another machine.&lt;BR /&gt;&lt;BR /&gt;Thanks for all the help.</description>
      <pubDate>Wed, 21 Jan 2004 11:51:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/error-find-cannot-get-pwd/m-p/3168657#M160923</guid>
      <dc:creator>Ratzie</dc:creator>
      <dc:date>2004-01-21T11:51:59Z</dc:date>
    </item>
  </channel>
</rss>

