Logs to be gzipped


 
Thread Tools Search this Thread
Top Forums UNIX for Beginners Questions & Answers Logs to be gzipped
# 1  
Old 03-15-2019
Logs to be gzipped

Dear Friends,


I need to zip all the file in the log folder with date and time, except current days files and files with .gz extension.


Regards,
Search4u2003.
# 2  
Old 03-15-2019
Greetings,

What have you come up with so far?
# 3  
Old 03-15-2019
I'm a newbie and don't know how to go along with this.
# 4  
Old 03-15-2019
Well there are many options, then it depends of your architecture as unix command argument may differ, so for a start you should tell on what OS you are dealing with and the shell you use only we are not going to do the work for you as you will learn nothing, as all the people I know except a very few, we tend to be lazy and look for the most obvious and easy way out:
For that it means to see the content of that log directory as if there are only 2 files of the day why should we bother using the command find (IMHO I am guilty if others dont agree Smilie ) as for a newbie that command seems to have an obscure and complicated syntax, then see how many .gz files we have...
How would you do that?
This User Gave Thanks to vbe For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

If I ran perl script again,old logs should move with today date and new logs should generate.

Appreciate help for the below issue. Im using below code.....I dont want to attach the logs when I ran the perl twice...I just want to take backup with today date and generate new logs...What I need to do for the below scirpt.............. 1)if logs exist it should move the logs with extention... (1 Reply)
Discussion started by: Sanjeev G
1 Replies

2. UNIX for Advanced & Expert Users

Passing resulted string name of a gzipped file as an argument to another piped tool

Hi, I have a .pcap.gz file and I would like to initially gzip it and then pass the resulting .pcap filename as an argument to a piped tool; the right-hand tool is not standardized linux tool but a custom one that strictly requires the string name of a given .pcap file in order for the pcap file... (2 Replies)
Discussion started by: amarn
2 Replies

3. UNIX Desktop Questions & Answers

regarding logs

Hi , I am running an application on my windows and it logs are generated at /var/logs and for this i have to go this location and then do tail -f , Is there any command you can advise me so that when I execute this command at this location that logs get displayed fully and as the application... (3 Replies)
Discussion started by: KAREENA18
3 Replies

4. UNIX for Dummies Questions & Answers

view gzipped files with name file.gz.$DATE on a Solaris box (without unzipping first)

Hi Howto view gzipped files with name file.gz.$DATE on a Solaris box (without unzipping first) $ ls -lrt total 4477 -rwxrwxr-x 1 oracle dba 569745 Apr 4 19:45 4_person2profileCon.txt.gz.04.04.11* -rwxrwxr-x 1 oracle dba 3783 Apr 4 19:45... (4 Replies)
Discussion started by: slashdotweenie
4 Replies

5. Shell Programming and Scripting

Grep yesterday logs from weblogic logs

Hi, I am trying to write a script which would go search and get the info from the logs based on yesterday timestamp and write yesterday logs in new file. The log file format is as follows: """"""""""""""""""""""""""... (3 Replies)
Discussion started by: harish.parker
3 Replies

6. UNIX for Advanced & Expert Users

logs

Hy, I have a question I have a directory in a unix server, Some of my files have a diffrent access time, from the time i accessed them last, I think some one has copied it,it's not an important file,but none the less,it is my file,It mistakenly had a 777 permission( yes ,I know it is a noob's... (1 Reply)
Discussion started by: lordmod
1 Replies

7. Shell Programming and Scripting

Logs

Hey Guys, i am new into shell programming and i have to do one script which have to record all the commands entered by a specific user. Example of that, i have a system running on unix, several users are using this system, i have to create like a databse which will record every user entered that... (5 Replies)
Discussion started by: charbel
5 Replies

8. UNIX for Dummies Questions & Answers

logs

can i include this command into my crontab file > /var/adm/wtmp to clear the contents on a regular basis ? what about file permissions ? (6 Replies)
Discussion started by: cubicle^dweller
6 Replies

9. UNIX Desktop Questions & Answers

Logs

hi My name is Juan I dont can clear wtmp and similiar files how i do it? thanks (4 Replies)
Discussion started by: jtapia
4 Replies
Login or Register to Ask a Question