LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-18-2007, 01:30 AM   #1
sathyguy
Member
 
Registered: Sep 2005
Location: Indian Working in Saudi Arabia
Distribution: Redhat Linux AS 3.0
Posts: 93

Rep: Reputation: 15
Can anybody check this copy,remove and chown scripts?


Friends,

Is there any other easy way?

Note:All the ipaddress mentioned here are dummy.

1. im deleting some oracle files in the server using oracle (os user)will this script deletes only *.ctl,*.log,*.dbf,*.arc in the last folder?

rmfiles.sh contains....

Quote:
#!/bin/bash
# Place this file in /u03/script/ in the test server.
# login in as Oracle user and
# Run the script to delete the below files from the server
#
rm -rf /u01/app/oracle/oradata/LIVEDB/*.ctl /u01/app/oracle/oradata/LIVEDB/*.dbf /u01/app/oracle/oradata/LIVEDB/*.log
rm -rf /control/oradata/*.dbf
rm -rf /u03/LIVEDB/*.dbf
rm -rf /control/LIVEDB/*.ctl /control/LIVEDB/*.log
rm -rf /u02/archive1/LIVEDB/*.arc /u02/archive2/LIVEDB/*.arc
#
echo "FILES DELETED"
2. Now im copying some files from local pc to server. Will it ask a password for 4 times. is it possible to ask the password only one time? Also, is the below server copy command is correct?

cpfiles.sh contains.....


Quote:
#!/bin/bash
# Place this file in the backup pc(/backup/scripts) and
# Edit this file for the required archive file and run the script as root user
#
#
scp /backup/u01/system01.dbf /backup/u01/undotbs01.dbf root@111.11.1.1:/control/oradata/
#
#
scp /backup/u01/cwmlite01.dbf /backup/u01/drsys01.dbf /backup/u01/indx01.dbf /backup/u01/odm01.dbf /backup/u01/tools01.dbf /backup/u01/users01.dbf /backup/u01/xdb01.dbf root@111.11.1.1:/u01/app/oracle/oradata/LIVEDB/
#
#
scp /backup/u01/LIVEDB_DEFAULT.dbf root@111.11.1.1:/u03/LIVEDB/
#
# Copy the necessary archive files
scp /backup/archive/ar0000876*.arc root@111.11.1.1:/u02/archive2/LIVEDB/
#
echo "FILES COPIED"

3. now i have to change the ownership of the copied file.
will it changes only *.dbf,*.arc in the below given folder?

chownfiles.sh contains....


Quote:
#!/bin/bash
# Place this file in the /u03/scripts/ in the test server.
# login in as root user and
# Run the script to change the ownership of the below files.
#
#
chown oracle.oinstall /control/oradata/*.dbf
chown oracle.oinstall /u01/app/oracle/oradata/LIVEDB/*.dbf
chown oracle.oinstall /u03/LIVEDB/*.dbf
chown oracle.oinstall /u02/archive2/LIVEDB/*.arc
#
#
echo "FILES OWNER CHANGED"


Thanks
Sathyguy
 
Old 03-19-2007, 12:05 AM   #2
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Arch
Posts: 3,013

Rep: Reputation: 1225Reputation: 1225Reputation: 1225Reputation: 1225Reputation: 1225Reputation: 1225Reputation: 1225Reputation: 1225Reputation: 1225
Quote:
Originally Posted by sathyguy
Friends,

Is there any other easy way?

Note:All the ipaddress mentioned here are dummy.

1. im deleting some oracle files in the server using oracle (os user)will this script deletes only *.ctl,*.log,*.dbf,*.arc in the last folder?
looks OK

Quote:
2. Now im copying some files from local pc to server. Will it ask a password for 4 times. is it possible to ask the password only one time? Also, is the below server copy command is correct?
see http://www.linuxquestions.org/linux/...ation_with_ssh

You might be better off not using root with scp, though, it's not considered a good idea to allow root to login via ssh.


Quote:
3. now i have to change the ownership of the copied file.
will it changes only *.dbf,*.arc in the below given folder?
looks ok, but like I said, maybe you should consider copying with that user to being with...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy scripts yawe_frek Programming 3 02-27-2007 11:46 AM
LXer: Remove the smell from your build scripts LXer Syndicated Linux News 0 10-14-2006 05:21 AM
Scripts to check if a process is running kt8993 Programming 3 07-09-2005 06:32 PM
Scripts tp Check Network Connections assyrian47 Programming 2 06-18-2004 02:19 PM
Is it safe to remove the startup scripts? Retrievil_Knievil Linux - Hardware 3 04-14-2004 05:12 PM


All times are GMT -5. The time now is 02:52 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration