LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-24-2004, 11:03 AM   #1
sujte
Member
 
Registered: Jul 2003
Posts: 48

Rep: Reputation: 15
Scripting question


I have a shell script that basically is supposed to do the following

1. calls oracle and executes sql scripts that create .doc files in the current directory
2. deletes existing .doc files in a reports directory
3. copies the new .doc files into the reports directory

I run the script as the oracle user, and the files are created/owned by the oracle user. I echo a whoami in the script, and of course it returns 'oracle'.

I am having trouble deleting the existing files. The script gets the following error on the delete command,

rm: cannot lstat `/var/www/html/dailyReports/DTC/TST_*': No such file or directory

using rm -rf doesn't give an error, but it doesn't delete anything either.

I even tried a simple ls -l on the directory and got the following error

ls: /var/www/html/dailyReports/DTC/TST_*: No such file or directory

I can execute the commands at the command line (as the oracle user) with no problem, but they will not execute in the script.

Any ideas? I'm thinking it must be something simple that I am missing.
 
Old 05-24-2004, 01:51 PM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
When you run
ls -la /var/www/html/dailyReports/DTC/

What do you get? Specifically - what are the permissions on the directory and the TST_* files.
 
Old 05-24-2004, 04:52 PM   #3
sujte
Member
 
Registered: Jul 2003
Posts: 48

Original Poster
Rep: Reputation: 15
In the following example, I want to remove the RH1* directory via my script before creating another one. The following output is from the ls -la command

The directories that are dynamically created in the script has the following permissions

drwxr-xr-x 2 oracle dba 4096 May 24 16:13 RH1_05242004_1613
drwxr-xr-x 2 oracle dba 4096 May 24 16:19 TST_05242004_1618


the files in the directories have the following permissions

-rwxrwxrwx 1 oracle dba 237567 May 24 16:13 RH105242004_EXTENT.doc
-rwxrwxrwx 1 oracle dba 2767 May 24 16:13 RH105242004_FILEIO.doc
-rwxrwxrwx 1 oracle dba 1135 May 24 16:13 RH105242004_FRAG.doc
-rwxrwxrwx 1 oracle dba 1784 May 24 16:13 RH105242004_FREESPACE.doc
-rwxrwxrwx 1 oracle dba 4335 May 24 16:13 RH105242004_LATCH.doc
-rwxrwxrwx 1 oracle dba 488 May 24 16:13 RH105242004_MAXEXTENT.doc
-rwxrwxrwx 1 oracle dba 3137 May 24 16:13 RH105242004_ROLLBACK.doc
-rwxrwxrwx 1 oracle dba 2513 May 24 16:13 RH105242004_SHARED_POOL.doc
-rwxrwxrwx 1 oracle dba 3979 May 24 16:13 RH105242004_WAITS.doc
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
scripting question... Basslord1124 Linux - Networking 2 11-09-2005 05:52 AM
Scripting question mithereal Linux - General 2 09-21-2005 02:02 AM
Scripting question msandford Linux - Newbie 4 09-05-2005 10:23 AM
scripting question gearoid Programming 3 05-26-2004 02:43 PM
Scripting question glock19 Linux - Software 2 09-05-2003 12:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:22 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration