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
dtoc(1) 						      General Commands Manual							   dtoc(1)

Name
       dtoc - unpack objects from a DOTS file

Syntax
       dtoc [ -f ] [ -p ] [[ object.dots ] directory ]

Description
       The command unpacks the contents of a Data Object Transport Syntax (DOTS) file or standard input.

       object.dots  can  be  either a file name, or a minus sign (-).  If a minus sign (-) is specified, or if no file name is present, reads from
       the standard input.  If directory is specified, the contents of the DOTS input is unpacked and  stored  in  the	specified  directory.	If
       directory is not specified, the content of the DOTS input is unpacked into the current directory.  The names of the files created are writ-
       ten to standard output.

       A DOTS file may contain a data object which consists of more than one component.  Therefore, it is possible that more than one output  file
       may  be	generated.  As the object is unpacked, duplicate file or directory names may be encountered.  If a duplicate is encountered, a new
       output file is generated with a sequential number appended to its name.	For example, if discovers an existing file  during  unpacking,	is
       created.

       As  an  object  is unpacked, the external references within each object component are updated.  Because DOTS files may have originated from
       non-ULTRIX systems, names of components may be modified as components are unpacked.  References to those  renamed  components  are  updated
       accordingly.

Options
       -f   Suppresses output of unpacked file names.

       -p   Causes only the name of the primary input file to be written to standard output.

Implementation
   Standard Input
       If  a minus sign (-) is specified, or if no parameters are specified, standard input is read until a or EOF (end of file) is read.  It can-
       not be specified more than once.  The contents of standard input must conform to the syntax of a single DOTS file.

   Reconstitution Of Names
       Object file names and file names of referenced components may be modified as objects are extracted or unpacked.	If names are modified, the
       references in the unpacked objects are updated.	The handling of names depends in part on the name-type of the object, as follows:

	      ULTRIX file names

		     Names are unmodified.

	      VMS file names

		     The set of rules is as follows:

			    Convert uppercase letters to lower case.

			    Convert dollar signs ($) to underscores (_) because dollar signs have meaning on ULTRIX systems.

			    Ignore  disk volume and directory specifications, if they are present, because they are not likely to be meaningful on
			    ULTRIX systems.

			    Append duplicate file names with a period and a unique number.

			    Leave all other characters alone.

Restrictions
       A DOTS file is expected to contain only a single primary DDIF or DTIF object in this release.  Any subsequent objects in the DOTS file  are
       external references of the primary object.

Diagnostics
       The  exit status is 0 if all objects were unpacked successfully, and 1 if any of the objects could not be unpacked.  Consult standard error
       to see what failed, and why.

       If a nonexistent target directory is specified, returns error status.

See Also
       ctod(1), DDIF(5), DTIF(5), DOTS(5)

																	   dtoc(1)
All times are GMT -4. The time now is 04:21 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy