The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
chown BG_JrAdmin UNIX for Dummies Questions & Answers 2 04-17-2009 08:22 AM
reg chown ilayans UNIX for Dummies Questions & Answers 2 11-06-2008 07:34 AM
chown ariec AIX 2 08-14-2007 04:24 PM
chown and permissions ithost UNIX for Dummies Questions & Answers 1 07-03-2003 08:18 AM
chown and NIS Jody UNIX for Dummies Questions & Answers 2 07-01-2003 02:57 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 12-19-2008
walkerl walkerl is offline
Registered User
  
 

Join Date: Dec 2008
Posts: 1
Trying to untar then chown, and chmod

I'm changing (trying to anyway) a script that will need to unrar a file, this file will create a directory with files in it. Then I need to change the owner ship and permission on that directory. Finally, I will rsync the directory to another machine.

This is what I have so far.

#!/bin/bash

###Grab the name of the .trz file and unzip

echo -e "Enter the name of the patch file: \c"
read file
tar -zxf $file
##### This is where I'm stuck, not sure what the next step is.


####Below was the original script that would rsynce the directory if the permissions were already set and the file was already untarred####

echo -e "Please enter the directory of patch (exclude trailing slash) : \c"
read patch
rsync -rpvgo --force $patch user@somemachine.com:/srv/patches
rsync -rpvgo --force $patch user@somemachine.com:/srv/patches
  #2 (permalink)  
Old 12-19-2008
Lakris Lakris is offline
Registered User
  
 

Join Date: Oct 2007
Posts: 246
Quote:
Originally Posted by walkerl View Post
I'm changing (trying to anyway) a script that will need to unrar a file, this file will create a directory with files in it. Then I need to change the owner ship and permission on that directory. Finally, I will rsync the directory to another machine.
Hello there!
You say unrar but use tar?
Not that I know how You use this script but maybe You could consider passing the filename as a parameter? Unless You are doing some looping here...

What are You missing? Setting mode on the unpacked files? Do You know what settings You want? Do You know where You have unpacked the files?
If, as an example, You have unpacked them in Your current, previously empty, working directory then I guess
Code:
chmod -R 777 .
chown -R user.user .
Closed Thread

Bookmarks

Tags
chmod, chown, tar

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 06:31 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0