Tar archives monthly


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Tar archives monthly
# 8  
Old 07-13-2015
Indeed, but there is way to do it automatically, without have to right the /full/path/to/

I want that he tar the file in the directory where he finds the file

Last edited by rbatte1; 07-13-2015 at 11:14 AM.. Reason: Spelling & capital letters
# 9  
Old 07-13-2015
That depends on the file/directory structure that you have. Are there one or many directories? Are there one or many matching files in each directory? Should one or all matching files be tarred together, within or across directories?
# 10  
Old 07-13-2015
i have few directories


Code:
under /tmp/w/a 
files  test  2014 01 05
         test1 2014 01 08
         test3 2014 02 09
under /tmp/w/b
files  test6  2014 01 05
         test7 2014 02 08
         test8 2014 02 10

if i run
Code:
find /tmp/w/ -type f -newermt '2014-01-01' ! -newermt '2014-02-01' -print0 | tar czvf file01.tar.gz --null -T -

in /tmp , it will compress the files under /tmp/
but i pretend that files would be compress in their in directory that they are by month ,
this is the only detail that is missing
Moderator's Comments:
Mod Comment PLEASE use CODE tags when showing sample input and output as well as code segments.
Without CODE tags, sequences of spaces and tabs are displayed as a single space and aligned text loses its alignment.

Last edited by Don Cragun; 07-13-2015 at 05:40 PM.. Reason: Add more CODE tags.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Multi-Volume tar archives. [solved]

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)
Discussion started by: MikeGM
0 Replies

2. Shell Programming and Scripting

tar command to explore multiple layers of tar and tar.gz files

Hi all, I have a tar file and inside that tar file is a folder with additional tar.gz files. What I want to do is look inside the first tar file and then find the second tar file I'm looking for, look inside that tar.gz file to find a certain directory. I'm encountering issues by trying to... (1 Reply)
Discussion started by: bashnewbee
1 Replies

3. Shell Programming and Scripting

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. ... (2 Replies)
Discussion started by: Steelysteel
2 Replies

4. Post Here to Contact Site Administrators and Moderators

monthly membership??

Hi, Do we have monthly membership (VIP) in our forum? if not, do we have any plans for it? Regards, (1 Reply)
Discussion started by: clx
1 Replies

5. UNIX for Dummies Questions & Answers

tar -cvf test.tar `find . -mtime -1 -type f` only tar 1 file

Hi all, 4 files are returned when i issue 'find . -mtime -1 -type f -ls'. ./ora_475244.aud ./ora_671958.aud ./ora_934052.aud ./ora_934050.aud However, when I issued the below command: tar -cvf test.tar `find . -mtime -1 -type f`, the tar file only contains the 1st file -... (2 Replies)
Discussion started by: ahSher
2 Replies

6. OS X (Apple)

Decompressing Tar Archives (Finally!)

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)
Discussion started by: unimachead
2 Replies

7. Shell Programming and Scripting

monthly calculation

pls can anyone help me with this script, the script is below, i need the script to get the previous month result every new month , the problem is that the loop has to be automated to always calculate for previous month . a=`date "+%Y"` #this year to be used b=$(date "+%Y%m" --date='49 days... (6 Replies)
Discussion started by: neyo
6 Replies

8. UNIX for Dummies Questions & Answers

flash archives

HI, are you supposed to run flarcreate in multi user mode? or should you do it in single user? (1 Reply)
Discussion started by: BG_JrAdmin
1 Replies

9. UNIX for Dummies Questions & Answers

segmenting tar archives

assuming i need to create a tar archive which would turn out to be bigger than 2gb, how could i segment the archive into say, 1 gb parts? (3 Replies)
Discussion started by: crudealien
3 Replies

10. UNIX for Dummies Questions & Answers

tar archives

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)
Discussion started by: sam_pointer
4 Replies
Login or Register to Ask a Question