Create unique tar archives from a list of directories
I'm looking to archive a client directory from a CIFS share
There are multiple directories that will be stored in a text file and I'm looking to
create an individual tar archive of each folder in the directory.
I've tried a number of commands to no avail.
Here's what I would like.
text file contents
output:
This command appears to work but the tar file isn't created in my current directory.
*Update*
I did some more testing while typing this and figured out that if I change $i.tar to test.tar, the archive is created. I would like the archive to have the name of the directory that is being archived.
Any ideas of a better way to accomplish this?
Last edited by Franklin52; 05-16-2011 at 02:59 AM..
Reason: Please use code tags
Thanks but my problem is that the text file contains directories in other filesytems. When I run this script, it's creating the tar within the directory it's tarring.
I want it stored in my current directory. So when I change it point to my current directory, i get an error.
Anyone?
---------- Post updated at 08:10 PM ---------- Previous update was at 07:45 PM ----------
I got the solution...
Last edited by Franklin52; 05-17-2011 at 03:34 AM..
Reason: Code tags
Hi...
Thanks to read this...
I want to use mkdir to create many directories listed in a text file, let's say.
How do I do this?
Sorry for this maybe very basic question :) (13 Replies)
To bakunin and corona688:
My result when text in file is
ms_ww_546
ms_rrL_99999
ms_nnn_67_756675
is
https://www.unix.com/C:\Users\Fejoz\Desktop\ttt.jpg
I hope you can see the picture. There is like a "whitespace character" after 2 of the 3 created directories.
---------- Post... (0 Replies)
Gents,
Please can you help.
I want to create a list which contends the complete patch of the location of some directories with the size of each file.
need to select only .txt file
In this case I am try to find the subdirectories tp1 and tp2 and create the output list.
jd175-1
tp1... (3 Replies)
Hi,
I want to archive files by month,
is there anyway of this code looks better?
find /tmp/w/ -type f -newermt '2014-01-01' ! -newermt '2014-02-01' | xargs tar -czvf files01.tar
find /tmp/w/ -type f -newermt '2014-02-01' ! -newermt '2014-03-01' | xargs tar -czvf files02.tar
find... (9 Replies)
Hi,
The only off-line storage medium I have is DVD. I am trying to back up around 10G of data and if I can achieve a practical solution I will use it more generally.
I am currently considering something along the lines of:
tar --create --multi-volume --tape-length=nnnn <pathspec>
|... (0 Replies)
If you've come across this problem with unzipping/decompressing zips, you might find this helpful:
I was having a little trouble with unzipping (decompressing) tarred archives under OS 10.5 until today. My first attempt was to just simply double-click on the zip file (i.e., example.tar.gz) and... (2 Replies)
Hi,
On my Unix Server in my directory, I have 70 files distributed in the following directories (which have several other files too). These files include C Source Files, Shell Script Source Files, Binary Files, Object Files.
a) /usr/users/oracle/bin
b) /usr/users/oracle... (1 Reply)
I have a tar archive which I believe may be corrupted, produced on an HP-UX 10.x box and written to a 4mm DDS-3 tape.
I understand that gnu tar has a -W (--verify) option which will attempt to verify the archive after it has been created. Am I right in saying that this option cannot be used to... (4 Replies)