[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

tar problem

Posted on 1999-11-16
1
Medium Priority
?
295 Views
Last Modified: 2010-04-27
my directory contains more than 3000 files. I don't want save all of them but when I perform tar command like

tar cvf /dev/rmt0 *.dat

tar exit with too many argument

I try to divide file into separated command:
tar cvf /dev/rmt0 a*.dat        
tar uvf /dev/rmt0 b*.dat        
 ... etc

but save perfomance where loss.


0
Comment
Question by:sfenati
1 Comment
 
LVL 32

Accepted Solution

by:
jhance earned 150 total points
ID: 2210814
The problem is that the unix command shell pre-expands an argument like "*.dat" before passing it to the tar command.  So tar is "seeing" a command like:

tar cvf /dev/rmt0 a.dat b.dat c.dat.......

etc. for all 3000 files and it's choking on it.  One option would be to use the -T option that would read the list of files to backup from a file.  So you could do:

ls *.dat >/tmp/BACKUP_FILES
tar cvf /dev/rmt0 -T /tmp/BACKUP_FILES
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is about my first experience with programming Arduino.
Want to create a VM?  Here's how you do it.
Enter Foreign and Special Characters Enter characters you can't find on a keyboard using its ASCII code ... and learn how to make a handy reference for yourself using Excel ~ Use these codes in any Windows application! ... whether it is a Micr…
How to fix display issue, screen flickering issue when I plug in power cord to the machine. Before I start explaining the solution lets check out once the issue how it looks like after I connect the power cord. most of you also have faced this…
Suggested Courses

640 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question