Sponsored Content
Full Discussion: Specific file list to be zip
Top Forums Shell Programming and Scripting Specific file list to be zip Post 302500254 by jagkoth on Monday 28th of February 2011 04:36:51 AM
Old 02-28-2011
Thanks for your prompt response here is my answers to your questions :

1. I am using Linux 2.6.31-14-generic #48-Ubuntu SMP GNU/Linux
2.
Code:
-rw-r--r-- 1 root root        46 2011-01-25 20:24 ab_xxxxxx.log.201101252024.gz
-rw-r--r-- 1 root root        46 2011-01-26 19:10 ab_xxxxxx.log.201101261910.gz
-rw-r--r-- 1 root root         0 2011-01-29 21:41 ab_xxxxxx.log.201102281726
-rw-r--r-- 1 root root         0 2011-01-30 18:54 ab_xxxxxx.log.201101301854
-rw-r--r-- 1 root root         0 2011-01-31 18:58 ab_xxxxxx.log.201101311858
-rw-r--r-- 1 root root         0 2011-02-01 15:14 ab_xxxxxx.log.201102201514
-rw-r--r-- 1 root root         0 2011-02-02 15:48 ab_xxxxxx.log.201102211548
-rw-r--r-- 1 root root         0 2011-02-03 15:42 ab_xxxxxx.log.201102221542
-rw-r--r-- 1 root root         0 2011-02-04 15:42 ab_xxxxxx.log.201102221542
-rw-r--r-- 1 root root         0 2011-02-05 15:42 ab_xxxxxx.log.201102221542
-rw-r--r-- 1 root root         0 2011-02-06 15:42 ab_xxxxxx.log.201102221542
-rw-r--r-- 1 root root         0 2011-02-07 15:42 ab_xxxxxx.log.201102221542
-rw-r--r-- 1 root root         0 2011-02-08 15:42 ab_xxxxxx.log.201102221542
.
.
.
.
..

-rw-r--r-- 1 root root         0 2011-02-18 15:42 ab_xxxxxx.log.201102221542
-rw-r--r-- 1 root root         0 2011-02-19 15:42 ab_xxxxxx.log.201102221542
.
.
.
-rw-r--r-- 1 root root         0 2011-02-27 15:42 ab_xxxxxx.log.201102221542
-rw-r--r-- 1 root root         0 2011-02-28 15:00 ab_xxxxxx.log

Marking bold letters only I need such has only five files to be zipped automatically. similarly it should follow the same condition for next five files to be zipped only if i run the script. please note it should not zip current file ab_xxxxxx.log as well as last 10 days files. let me know if you have any questions and thank you for helping me out.

Last edited by jagkoth; 02-28-2011 at 12:23 PM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Is extracting specific files from a zip file possible?

If a zip file contains several zip files, but if the file names of the files needed are known, is there a variation of the unzip command that will allow those few (individual) files to be extracted? --- Example: Zip file name: zip.zip unzip -l zip.zip will display file01, file02, file03, etc.... (1 Reply)
Discussion started by: HLee1981
1 Replies

2. UNIX for Dummies Questions & Answers

unzip .zip file and list the files included in the .zip archive

Hello, I am trying to return the name of the resulting file from a .zip archive file using unix unzip command. unzip c07212007.cef7081.zip Archive: c07212007.cef7081.zip SecureZIP for z/OS by PKWARE inflating: CEP/CEM7080/PPVBILL/PASS/G0063V00 I used the following command to unzip in... (5 Replies)
Discussion started by: oracledev
5 Replies

3. Shell Programming and Scripting

Read specific file from a zip archive without extracting

Hi All, I would like to extract specific file from a zip archive. I have a zip archive "sample.zip". sample.zip contains few text files and images... text1.txt, text2.txt, pic.jpg etc... I need to read specific file "text2.txt" from "sample.zip" WITHOUT EXTRACTING the zip file. ... (4 Replies)
Discussion started by: sridharg
4 Replies

4. Shell Programming and Scripting

Matching a string (zip code) from a list in a separate file

I have a list of postal addresses and I need to pull the records that match a list of zip codes in a separate file. The postal addresses are fixed width. The zip code is located in character position 149-157. Something better than: cat postalfile.txt | grep -f zipcodes.txt would be great. $... (8 Replies)
Discussion started by: sitney
8 Replies

5. UNIX for Dummies Questions & Answers

Zip file with specific name

Hi, How could compress a file with a specific name. For example if I put the following: gzip -f file.dat I compressed it with the same file name to compress, "file.dat.gz". How could compress it with the name I want for example test.gz. Thanks. (4 Replies)
Discussion started by: pepeli30
4 Replies

6. Shell Programming and Scripting

Zip a list of specific files to an archive

Hi all, i've got the following problem: We've got a shell-script, that creates some different files based on several criteria given, using a sql-script. After creating, those files are individually zipped and stored, then sent to a ftp-server. This is all working since 2010, but now they have... (3 Replies)
Discussion started by: Biggreuda
3 Replies

7. Shell Programming and Scripting

Find all the files under a specific directory and zip them into a single file.

Hi, Is there a way to find all the files from a specific location and then zip them into a single file, even if they are in multiple directories? (3 Replies)
Discussion started by: rudoraj
3 Replies

8. Shell Programming and Scripting

Uncompressing .zip file specific directory Fedora 14

Hello, I have Fedora 14 installed on my machine I have a .zip file ( some latex package) which I want to unzip to some location in the Latex paths /usr/share.../texmf/.. so I went to super user mode, created the directory for this package over there, mkdir logo and tried... (1 Reply)
Discussion started by: ajayram
1 Replies

9. UNIX for Beginners Questions & Answers

How can we Zip multiple files created on the same date into one single zip file.?

Hi all i am very new to shell scripting and need some help from you to learn 1)i have some log files that gets generated on daily basis example: i have abc_2017_01_30_1.log ,2017_01_30_2.log like wise so i want to zip this 4 logs which are created on same date into one zip folder. 2)Post zipping... (2 Replies)
Discussion started by: b.saipriyanka
2 Replies

10. Shell Programming and Scripting

How can we Zip multiple files created on the same date into one single zip file.?

Hi all i am very new to shell scripting and need some help from you to learn 1)i have some log files that gets generated on daily basis example: i have abc_2017_01_30_1.log ,2017_01_30_2.log like wise so i want to zip this 4 logs which are created on same date into one zip folder. 2)Post zipping... (1 Reply)
Discussion started by: b.saipriyanka
1 Replies
sulog(4)							   File Formats 							  sulog(4)

NAME
sulog - su command log file SYNOPSIS
/var/adm/sulog DESCRIPTION
The sulog file is a record of all attempts by users on the system to execute the su(1M) command. Each time su(1M) is executed, an entry is added to the sulog file. Each entry in the sulog file is a single line of the form: SU date time result port user-newuser where date The month and date su(1M) was executed. date is displayed in the form mm/dd where mm is the month number and dd is the day number in the month. time The time su(1M) was executed. time is displayed in the form HH/MM where HH is the hour number (24 hour system) and MM is the minute number. result The result of the su(1M) command. A ` + ' sign is displayed in this field if the su attempt was successful; otherwise a ` - ' sign is displayed. port The name of the terminal device from which su(1M) was executed. user The user id of the user executing the su(1M) command. newuser The user id being switched to with su(1M). EXAMPLES
Example 1: A sample sulog file. Here is a sample sulog file: SU 02/25 09:29 + console root-sys SU 02/25 09:32 + pts/3 user1-root SU 03/02 08:03 + pts/5 user1-root SU 03/03 08:19 + pts/5 user1-root SU 03/09 14:24 - pts/5 guest3-root SU 03/09 14:24 - pts/5 guest3-root SU 03/14 08:31 + pts/4 user1-root FILES
/var/adm/sulog su log file /etc/default/su contains the default location of sulog SEE ALSO
su(1M) SunOS 5.10 6 Jun 1994 sulog(4)
All times are GMT -4. The time now is 06:12 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy