Sponsored Content
Operating Systems Linux Red Hat Need Script to ZIP/SAVE & then DELETE Log file & DELETE ZIPS older than 12 months Post 302743181 by zachs on Wednesday 12th of December 2012 08:19:29 AM
Old 12-12-2012
correct in a zip nothing fancy at all.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Overwrite & Delete in Text File

Dear All, I have text file like this: Header Record 1 Record 2 ....... Record n Tail This line of code : awk '{ if ( NR == 1 ) { head=substr($0,1,300);} else { last = substr($0,1,300);}END{printf "Header is : %-300s Trailer is : %-300s\n", head, last}' filename converted Header... (11 Replies)
Discussion started by: 33junaid
11 Replies

2. UNIX for Advanced & Expert Users

how to archive logs older than 5 days & then delete them?

My code is tar -cvf logs.tar `find /usr/openv/logs/512*.log -mtime +2` && find *.log* -mtime +2 -exec rm {} \; this gives me output as: tar: Missing filenames:confused: (1 Reply)
Discussion started by: timus1980
1 Replies

3. Shell Programming and Scripting

Delete files older than 3 months.(read date from the name of the file)

Guys, My log files stored in the date format format below(log_20080714072942): TIMESTAMP=`date +%Y%m%d%H%M%S` LOG=/log/log_${TIMESTAMP}.log I'm looking for a shell script which deletes all files which is older than 3 months from today. Regards, Bhagat (3 Replies)
Discussion started by: bhagat.singh-j
3 Replies

4. Shell Programming and Scripting

Shell script delete log files from folder & subfolders on space usage

Hi, I am trying to write a shell script to delete logs generate by db when space in the folder reaches 70%. i am getting space values from db, find the files at OS and remove them by using a cron job runs every 5minutes. I have to keep the latest 5 files at any time, my problem is that log files... (3 Replies)
Discussion started by: saha
3 Replies

5. Shell Programming and Scripting

help with tar & zip only last months(say,Sep) files

Need to 1. archive all the files in a directory from the previous month into a tar/gz file, ignoring all already archived 'tar.gz' files 2. Check created .tar.gz file isnt corrupted and has all the required files in it. and then remove the original files. I am using a function to get the... (1 Reply)
Discussion started by: Prev
1 Replies

6. Shell Programming and Scripting

[Solved] Get files & delete them by shell script

I want to use my script to get any file then delete it once it transfers to my side , I manage to create below script to generate "list" file which contains all file names in "10.10.1.1" then I made "a.out" file which contains the commands that I want to run it on "10.10.1.1" to get & delete the... (2 Replies)
Discussion started by: arm
2 Replies

7. Shell Programming and Scripting

Script needed to delete to the list of files in a directory based on last created & delete them

Hi My directory structure is as below. dir1, dir2, dir3 I have the list of files to be deleted in the below path as below. /staging/retain_for_2years/Cleanup/log $ ls -lrt total 0 drwxr-xr-x 2 nobody nobody 256 Mar 01 16:15 01-MAR-2015_SPDBS2 drwxr-xr-x 2 root ... (2 Replies)
Discussion started by: prasadn
2 Replies

8. Shell Programming and Scripting

Need Script to ZIP/SAVE & then DELETE Log file & send a mail conformation for any error

ENVIROMENT Linux: RHEL 6.4 Log Path: /usr/iplanet/servers/https-company/logs Log Format: user.log.03-15-2015 I have log4j log rotation enabled rotating files on a daily basis. The rotated logs are NOT compressed & are taking up too much space. I need a script that will run daily that... (1 Reply)
Discussion started by: admin_job_admin
1 Replies

9. UNIX for Dummies Questions & Answers

Log file - Delete duplicate line & keep last date

Hello All ! I need your help on this case, I have a csv file with this: ITEM105;ARI FSR;2016-02-01 08:02;243 ITEM101;ARI FSR;2016-02-01 06:02;240 ITEM032;RNO TLE;2016-02-01 11:03;320 ITEM032;RNO TLE;2016-02-02 05:43;320 ITEM032;RNO TLE;2016-02-01 02:03;320 ITEM032;RNO... (2 Replies)
Discussion started by: vadim-bzh
2 Replies

10. Shell Programming and Scripting

SFTP Shell Script Get & Delete && Upload & Delete

Hi All, Do you have any sample script, - auto get file from SFTP remote server and delete file in remove server after downloaded. - only download specify filename - auto upload file from local to SFTP remote server and delete local folder file after uploaded - only upload specify filename ... (3 Replies)
Discussion started by: weesiong
3 Replies
File::Rotate(3pm)					User Contributed Perl Documentation					 File::Rotate(3pm)

NAME
Log::Agent::File::Rotate - a rotating logfile set SYNOPSIS
# # This class is not user-visible. # # It is documented only for programmers wishing to inherit # from it to further extend its behaviour. # require Log::Agent::Driver::File; require Log::Agent::Rotate; require Log::Agent::File::Rotate; my $config = Log::Agent::Rotate->make(...); my $driver = Log::Agent::Driver::File->make(...); my $fh = Log::Agent::File::Rotate->make("file", $config, $driver); DESCRIPTION
This class represents a rotating logfile and is used drivers wishing to rotate their logfiles periodically. From the outside, it exports a single "print" routine, just like "Log::Agent::File::Native". Internally, it uses the parameters given by a "Log::Agent::Rotate" object to transparently close the current logfile and cycle the older logs. Before rotating the current logfile, the string: *** LOGFILE ROTATED ON <local date> is emitted, so that people monitoring the file via "tail -f" know about it and are not surprised by the sudden stop of messages. Its exported interface is: make file, config This is the creation routine. The config object is an instance of "Log::Agent::Rotate". print args Prints args to the file. After having printed the data, monitor the file against the thresholds defined in the configuration, and possibly rotate the logfiles according to the parameters held in the same configuration object. When the "is_alone" flag is not set in the configuration, the logfile is checked everytime a "print" is issued to see if its inode changed. Indeed, when several instances of the same program using rotating logfiles are running, each of them may decide to cycle the logs at some point in time, and therefore our opened handle could point to an already renamed or unlinked file. AUTHORS
Originally written by Raphael Manfredi <Raphael_Manfredi@pobox.com>, currently maintained by Mark Rogaski <mrogaski@pobox.com>. SEE ALSO
Log::Agent::Rotate(3), Log::Agent::Driver::File(3). perl v5.10.0 2002-05-14 File::Rotate(3pm)
All times are GMT -4. The time now is 10:20 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy