Sponsored Content
Top Forums UNIX for Advanced & Expert Users selective tar image and dir perms Post 22325 by gfarley on Friday 31st of May 2002 11:06:41 AM
Old 05-31-2002
Question selective tar image and dir perms

Hi,

I'm creating a tar image containing selected files held in a manifest file thus:

cat <manifest file> | xargs tar -cvpf tar.out

I need to preserve the directory as well as the file perms. When my list contains no separate directory lines, the directory is created implicitly when the first file is "untarred", but with incorrect permissions. My initial solution was to create a list entry for the directory. This preserves the dir perms, but of course grabs the entire directory contents.

Is it possible to tar up a directory entry without tar descending into it?

I'm on IRIX 6.5.6.

Thanks in advance.

Gary Farley.
 

10 More Discussions You Might Find Interesting

1. Filesystems, Disks and Memory

Using `tar` for a selective backup.

Hi all & anyone. I'm trying to selectively backup up some old Apache log files before they are removed from the system (Slackware box). Have created a file listing of what I want backed up ...Below is a portion of the file ./selectedbkup... (2 Replies)
Discussion started by: Cameron
2 Replies

2. UNIX for Dummies Questions & Answers

tar - Selecting target dir

Hi, 1 - How to select files to tar from a dir (indir) to the tar command? 2 - How to select the target directory where the files in a tar file should go to - I know that by default, tar remembers the path and restores files to that path. I am using HP-UX Thanks. (3 Replies)
Discussion started by: GNMIKE
3 Replies

3. UNIX for Dummies Questions & Answers

Tar Exclude Dir with a Specific Words

So here is what I got i have these directories names app-config app-exploded conf gen logs match src target currently i do: tar -cvf file.tar conf gen logs match src target What i want to do is: tar -cvf file.tar (exclude any dir with "app" in it) How can i... (1 Reply)
Discussion started by: rhartleyoh
1 Replies

4. Programming

Determining file access perms for current process

Stupid question, but is there an ANSI C stdlib function that will do this for me? I want to pass the function a path and determine if the current process can read/write/execute on the path. I suppose I can whip something up using fstat and then determining the current process's user/group IDs and... (6 Replies)
Discussion started by: DreamWarrior
6 Replies

5. Solaris

NFS server RW perms

Hi I can't write to fs "/share/nfs" shared by nfs server despite properly setting RW permissions. NFS server is configured on CentOS and Solaris10 is client. CentOS NFS Server config : -------------------------------- Entries in /etc/exports file : # cat /etc/exports /inst ... (6 Replies)
Discussion started by: presul
6 Replies

6. UNIX for Dummies Questions & Answers

Perms for Unix user

Can you describe how to give privileges to the user in normal use of your folder / home / user To be able to properly use Git and other applications of Python I've done something like chown-R myuser / home / myuser But there were some problems with Git commits.... like link unavailabe and... (3 Replies)
Discussion started by: sandrain
3 Replies

7. Shell Programming and Scripting

How to tar this dir excluding some files .au?

Hi all, Thanks for previous help. How to include this in script, I need to tar files which are present in /var/spool/cron/crontabs directory (used for crontab) excluding those files which are having extension .au /var/spool/cron/crontabs>>ls -ltr | grep -v .au total 438 -rw------- 1... (11 Replies)
Discussion started by: manalisharmabe
11 Replies

8. Shell Programming and Scripting

Using find for variable combination of perms

Hi, I'm trying to use find in kshell (AIX) to find all files with perms of write for other AND any execute bit set. e.g: r--r-x-w- would qualify and rw-rw--wx would qualify but ---rwxr-xr-x wouldn't qualify So far, I've been trying something like this: find . -type f -perm... (4 Replies)
Discussion started by: alanp36
4 Replies

9. Shell Programming and Scripting

HELP! I want to locate only dir and tar.gz

I making a script to restore apache from a configuration_backup tar. For now i want at the beginning of the script that you can make a choice to choose one of the configuration_backup tars. I use this code now: `locate /restore/configuration/configuration_backup*` But if i use this i get... (1 Reply)
Discussion started by: dannyvdberg
1 Replies

10. UNIX for Dummies Questions & Answers

How do I create a tar file for only dir and its subdir structures??

How do I create a tar file for only dir and its subdir structures?? (4 Replies)
Discussion started by: vx04
4 Replies
BF_TAR(1)						    Bogofilter Reference Manual 						 BF_TAR(1)

NAME
bf_tar - shell script to write a tar file of a bogofilter directory to stdout SYNOPSIS
bf_tar [-r] [-R] bogofilter_directory DESCRIPTION
bf_tar bundles a bogofilter working directory in tar format and copies it to standard output (your console, or where you redirect it, see EXAMPLES below). OPTIONS
The -r option causes bf_tar to remove inactive log files after the archive has been written successfully. The default is to leave log files. The -R option causes bf_tar to remove inactive log files before the archive is written. This may reduce chances that the resulting archive is recoverable should it become damaged. The archive may be smaller though. The default is to leave log files. EXIT STATUS
The script exits with status code 0 if everything went well, and nonzero if it encountered trouble. EXAMPLES
o bf_tar ~/.bogofilter > outfile.tar Writes a standard .tar file containing the essential files from ~/.bogofilter to outfile.tar. o bf_tar ~/.bogofilter | gzip -9 -c > outfile.tar.gz Writes a gzipped .tar.gz file containing the essential files from ~/.bogofilter to outfile.tar.gz. o bf_tar `pwd`/mydirectory > outfile.tar Prepend $(pwd)/ or `pwd`/ if you want to specify an absolute path instead of a relative path. NOTES
This script is meant for use with Berkeley DB based bogofilter versions. This script requires a SUSv2 compliant pax utility. This script expects a SUSv2 compliant shell. Solaris systems should have the SUNWxcu4 package installed (when bogofilter is configured) so that /usr/xpg4/bin/sh can be used. AUTHORS
Matthias Andree Bogofilter 03/15/2010 BF_TAR(1)
All times are GMT -4. The time now is 10:05 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy