Sponsored Content
Full Discussion: Tar archives monthly
Top Forums Shell Programming and Scripting Tar archives monthly Post 302949547 by prpkrk on Monday 13th of July 2015 03:53:17 AM
Old 07-13-2015
thanks for yours input , i will take that into consideration, but about the main question,
how can i make this code in better way , so i do not have to right it multiple times?
i try to do it with for cycles but as i have -newermt 2 times in same iteration it makes it harder
Code:
find /tmp/w/ -type f -newermt '2014-01-01' ! -newermt '2014-02-01' | pax -w | gzip > files01.tar.gz
find /tmp/w/ -type f -newermt '2014-02-01' ! -newermt '2014-03-01' | pax -w | gzip > files02.tar.gz
find /tmp/w/ -type f -newermt '2014-03-01' ! -newermt '2014-04-01' | pax -w | gzip > files03.tar.gz

 

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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

9. 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

10. 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
monthly(8)						      System Manager's Manual							monthly(8)

NAME
monthly - httpd log rotation for wwwstat SYNOPSIS
monthly DESCRIPTION
THIS PROGRAM MUST ONLY BE RUN ONCE PER MONTH! DURING THE FIRST WEEK It assumes a lot, like that you use wwwstat and archive your logfiles once per month. You will need to configure it for your server before it can be used. Reads the logfile (assumed to contain more than one month's worth of WWW common logfile entries) and moves the prior month's entries into a separate file. The new file is created on TMPDIR (to avoid filling up the disk), compressed using gzip, and then moved to the archive directory. The program also restarts the httpd server. SEE ALSO
crontab(1), httpd(1m), perl(1), wwwstat(1), splitlog(1), wwwerrs(8), oldlog2new(8) More info and the latest version of monthly can be obtained from http://www.ics.uci.edu/pub/websoft/wwwstat/ ftp://www.ics.uci.edu/pub/websoft/wwwstat/ If you have any suggestions, bug reports, fixes, or enhancements, please join the <wwwstat-users@ics.uci.edu> mailing list by sending e- mail with "subscribe" in the subject of the message to the request address <wwwstat-users-request@ics.uci.edu>. The list is archived at the above address. 18 November 2004 monthly(8)
All times are GMT -4. The time now is 08:13 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy