1834149 Members
2367 Online
110064 Solutions
New Discussion

Re: find: cannot open

 
Bruce Baillie
Regular Advisor

find: cannot open

I changed my daily backups from a remote tape drive to a local tape drive. All the directories are NFS mounted and the script is a find piped to cpio. If I login as root and run the find command, I get a cannot open on some directories. So, my question is: will running the script as cron still not visit those directories?
Why can't we all get along?
4 REPLIES 4
Rodney Hills
Honored Contributor

Re: find: cannot open

Does the NFS mounts have "root" specified in /etc/exports?

Rod Hills
There be dragons...
baiju_3
Esteemed Contributor

Re: find: cannot open

Yes , you can expect the same behaviour when run as root's cronjob.

Find out root cause for not opening directories , might me definetly permission problem.

or can make use of a remote tape drive by

tar cvf - * | remsh remote_host dd of=/dev/rmt/0m

thx.
Good things Just Got better (Plz,not stolen from advertisement -:) )
James R. Ferguson
Acclaimed Contributor

Re: find: cannot open

Hi Bruce:

The basic thing that seems to get forgotten when 'cron'ing an otherwise working script, is that 'cron's environment is very sparse.

In particular, the PATH is set thusly:

PATH=/usr/bin:/usr/sbin:.

That is, anything that you normally find having logged in and had '/etc/profile' and/or your $HOME/.profile read isn't there!

You need to supply an appropriate PATH for your script and/or any other variables you want defined in your environment.

Regards!

...JRF...
Bruce Baillie
Regular Advisor

Re: find: cannot open

OK, thanks. It's working now.
Why can't we all get along?