@vbe: I stumbled over exactly the same stone, as I did transfers a lot in the way you mention. BUT - alister said "tar doesn't read FILENAMES from stdin"; this is different to "tar reading archivable contents from stdin", and I believe he's right.
Last edited by RudiC; 02-07-2013 at 11:25 AM..
Reason: typo; typo again: alot --> a lot
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
Quote:
Originally Posted by manalisharmabe
I used this
This is a Sun Solaris 10 machine.
That solution is incorrect. Your grep invocation can exclude files which should not be excluded. While the regular expression .au will correctly exclude files ending with ".au", it will also exclude a file which contains any character followed by "au" at any point in the file name, such as myaudio.sh.
The correct approach requires backslash escaping the dot so that it is taken literally, and anchoring the regular expression to the end of the line:
Not of much importance, but there's no need to sort ls' output; -t and -r can be omitted. Further, since only the file name is of interest, no need for the long listing format, so -l can be dropped as well. Dropping the long listing format obviates the need for AWK, reducing your approach to:
However, I wouldn't use this command substitution approach. For years now, Solaris (and nearly every UNIX-like system, except perhaps for a few linux distributions) has shippied with pax. I'd just use that.
As added bonuses, now neither a large number of files nor files with whitespace will break the archiving attempt.
Hello AIX experts.
Hope this topic finds you well :)
Now, I will take a backup for a directory called medcbs.
Inside this directory 1 subdirectory I don't want to include it in the backup.
So, how to exclude it?
To be more clear, take a look to the following:
/bossapp1/medcbs>... (4 Replies)
Hi,
I would like to list all files, older than 7 days, in a directory, but exclude all subdirectories in the find command. If I use find . -type f -mtime +7 all files in the subdirs are also included. How can I exclude them?
Regards,
JW (6 Replies)
Hello i am using HP-UX rapdb2 B.11.23 U ia64 1068321383 unlimited-user license.
I am tryiyng to exclude for tar all files that start with TOT* but i doues not work
I am using:
tar -cvf /ODS/prepaid/CDR_FLOW/WORK/backup.tar --exclude='TOT*'
and i get the error:
tar: cannot stat... (3 Replies)
The title is not as easy as it sounds.... I am trying to exclude and file while ssh and untaring the file on the fly.
The command I am using is... The command typically works but recently I've add the X option along with the exclude file. Essentially, the exclude file is being ignored when run... (2 Replies)
I am attempting to write a housecleaning script that does the following:
1) goes to a specific directory
2) deletes all contents of that directory but a specific directory within it.
So my users all keep and use the Shared directory in OSX. Within /Users/Shared there are also standard named... (1 Reply)
hi,
How do i create a tar file of a directory excluding the links in that particular directory and its sub-directories.
The below command doesnt work for me.
tar -cvf abc.tar /dir1 --exclude"^l" (1 Reply)
In a bash script I am writing I am having a problem excluding selected directories from tar.
From the machine $SERVER I issue the command
#start netcat on storage server
gnetcat -l -vv -p 2011 >$FILEPATH/$SHORT_NAME.$today.tar &
The the following command is then sent to the $CLIENT.
#start... (2 Replies)
Hi All,
I'm having trouble with creating a compressed tar file with tar cXzfv and even with normal cvXf
I created a simple test below.. can anyone spot the mistake I'm making??.. its driving me up the wall..
In the end I need a compressed tarball....
Thanks in advance!!
Sam
... (11 Replies)
Hi ,
I want to backup the root file system but the size of / is very huge so I want to exclude some file systems.Man page of tar says X option excludes files but I could not do that.I use this command
$ tar -cvf deneme.tar -X exc .
$ cat exc
sql
kkm
I think there... (2 Replies)