Sponsored Content
Top Forums Shell Programming and Scripting Trying to untar then chown, and chmod Post 302270115 by Lakris on Friday 19th of December 2008 06:30:03 PM
Old 12-19-2008
Quote:
Originally Posted by walkerl
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 .

 

10 More Discussions You Might Find Interesting

1. AIX

chown

hello chown not change ownership before: 205:system ~kuku chown kuku:system ~kuku after no change 205:system ~kuku aix box can someone help me? ariec (2 Replies)
Discussion started by: ariec
2 Replies

2. UNIX for Advanced & Expert Users

chown issue

I have a strange problem in my Linux box (Suse). Recently I took over this box as admin even though I have no prior admin experience. Following is my issue I had following users under 'root' group initially user1 user2 user3 Since I did not like user ids under root group. I modifed these... (9 Replies)
Discussion started by: praveenkumar_l
9 Replies

3. UNIX for Dummies Questions & Answers

chown

is there a difference in chown on a file or a directory? how do i chown a directory and all the contents? (2 Replies)
Discussion started by: BG_JrAdmin
2 Replies

4. Shell Programming and Scripting

cp, chown, untar

hello i want shell script. i have a source.txt /home/user409/public_html/test/ /home/user09876/public_html/xdsss/ /home/user9765/public_html/320xxx/ . . . maybe 1000 lines i want . 1.read a source.txt 2.untar special.tar.gz into these directory in source.txt 3.i want to... (14 Replies)
Discussion started by: topic32428285
14 Replies

5. Shell Programming and Scripting

Chown - error

I have a file fin2009_4.txt.gz in the unix ftp server. Owner of the file is: ftpusr. -rw-r--r-- 1 ftpusr sap 0 Feb 19 10:19 fin2009_4.txt.gz When I try to delete this file after copying to my home folder, I am getting the following error. rm: fin2009_4.txt.gz1: override... (4 Replies)
Discussion started by: sid1982
4 Replies

6. UNIX and Linux Applications

What is the difference between chmod in solaris and chmod in Linux?

i think it is the same in both... Iam i right? (1 Reply)
Discussion started by: sumaiya
1 Replies

7. Solaris

chown

Hello My oracledatabase creats some xmlfiles. this files has the owner hugo. now I've a script (how runs als hugo2) and this script will insert this XMLFile into the database. But that doesn't work, because the owner of the files is wrong, and hugo has not the rights to insert this files into... (3 Replies)
Discussion started by: Street
3 Replies

8. Shell Programming and Scripting

excluding a directory with chown, chmod

does anyone know how to exclude a directory with chown or chmod? im trying to do something like this chown $username:$username $directory/* chown $username:$username $directory/.* chown $username:$username $directory and find $directory/* -type f -exec... (1 Reply)
Discussion started by: vanessafan99
1 Replies

9. Shell Programming and Scripting

Chmod working in sudo run script but chown isn't

My git user has permission in sudoers to run a wrapper script to move files into my webroot. Everything is working fine except for the chown line. After the script has run, the files ar still root:root instead of apache:apache. Scratching my head...:confused: #!/bin/sh echo echo "****... (4 Replies)
Discussion started by: dheian
4 Replies

10. UNIX for Dummies Questions & Answers

How to log all file that has been move,chmod,chown?

Hi All, Seeking for your assistance on how to log that has been chmod,mv,chown,chgrp and how to prevent script running while chmod,mv,chown,chgrp are still running? Ex: a/b/c-folder file1.txt file2.txt file3.txt chmod 777 * chown owner owner group mv what i did was(please see... (6 Replies)
Discussion started by: nikki1200
6 Replies
chown(1)						      General Commands Manual							  chown(1)

NAME
chown - Changes the owner of files or directories SYNOPSIS
chown [-fhR] owner [:group] file... The chown command changes the owner of the specified files or directories to the specified user name or user ID. STANDARDS
Interfaces documented on this reference page conform to industry standards as follows: chown: XCU5.0 Refer to the standards(5) reference page for more information about industry standards and associated tags. OPTIONS
[Tru64 UNIX] Turns off error reporting. [Tru64 UNIX] If file is a symbolic link, chown -h file changes the owner of the symbolic link. The chown file format changes the owner of the file referenced by the symbolic link. Descends recursively through its directory arguments, setting the specified owner. OPERANDS
The pathname of the file for which ownership is to be changed. A user ID and optional group ID to be assigned to file. The owner portion of this operand must be a user name from the user database or a numeric user ID. Either specifies a user ID to be given to each file named by one of the file operands. If a numeric owner operand exists in the user database as a user name, the user ID number associated with that user name will be used as the user ID. If the group portion of this operand is present, it must be a group name from the group database or a numeric group ID. Either spec- ifies a group ID to be given to each file. If a numeric group operand exists in the group database as a group name, the group ID number associated with that group name will be used as the group ID. DESCRIPTION
[Tru64 UNIX] Only a user with superuser authority can use the chown command. The owner argument must be a valid user name or a valid numerical user ID. The optional group argument must be a valid group name or a valid numerical group ID. EXIT STATUS
The following exit values are returned: The chown command executed successfully and all requested changes have been made. An error occurred. EXAMPLES
To change the owner of the file program.c, enter: chown steffan program.c The user access permissions for program.c now apply to steffan. As the owner, steffan can use the chmod command to permit or deny the other users access to program.c. See the chmod command for details. ENVIRONMENT VARIABLES
The following environment variables affect the execution of chown: Provides a default value for the internationalization variables that are unset or null. If LANG is unset or null, the corresponding value from the default locale is used. If any of the internationalization vari- ables contain an invalid setting, the utility behaves as if none of the variables had been defined. If set to a non-empty string value, overrides the values of all the other internationalization variables. Determines the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as opposed to multibyte characters in arguments). Determines the locale for the for- mat and contents of diagnostic messages written to standard error. Determines the location of message catalogues for the processing of LC_MESSAGES. FILES
Contains user names and numeric user IDs. SEE ALSO
Commands: chgrp(1), chmod(1), passwd(1) Functions: chown(2), chmod(2) Files: passwd(4) Standards: standards(5) chown(1)
All times are GMT -4. The time now is 09:28 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy