07-15-2008
If the date on the file name is the same as the last modified time you may use.
find . -name '*.log' -mtime +90 -exec rm {} \;
-rw-r--r-- 1 owner group 10322 Jul 14 23:47 log.071408
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
A script or command to list files older than 2 months in a specified directory and remove it. (3 Replies)
Discussion started by: pbekal
3 Replies
2. Shell Programming and Scripting
Hi,
Iam trying to delete 6 months old files.
Iam using the following script
-ctime +190 -type f -exec echo rm {} \;
Iam getting an error saying -ctime not found. (6 Replies)
Discussion started by: Sompalle Jalaja
6 Replies
3. Shell Programming and Scripting
Hello,
I want to gzip files in a folder in bulk i.e. all files older than 1 month should be in *.gz format. Could you please suggest how this can be achieved. Thanks.
Regards,
Alok (1 Reply)
Discussion started by: alok1301
1 Replies
4. Shell Programming and Scripting
Hi Viewer,
I need logic code for moving the logs files from one directory to another directory.
source :/xxxxxx/ xxxxxx / xxxxxx / xxxxxx / log --- under log directory we have so many files from last two years
Here I need to check the files older than two months and I need to move in... (5 Replies)
Discussion started by: munna_su
5 Replies
5. Shell Programming and Scripting
Hi Gurus
the count of files in a particular Directory...
ls -lrth | grep -c ^-
can any one share the command to Count the files which is Older than 3 months
So please help me out in this
Thanks in Advance (2 Replies)
Discussion started by: SeenuGuddu
2 Replies
6. Shell Programming and Scripting
To delete log files content older than 30 days and append the lastest date log file date in the respective logs
I want to write a shell script that deletes all log files content older than 30 days and append the lastest log file date in the respective logs
This is my script
cd... (2 Replies)
Discussion started by: sreekumarhari
2 Replies
7. Red Hat
ENVIROMENT
Linux: Fedora Core release 1 (Yarrow)
iPlanet: iPlanet-WebServer-Enterprise/6.0SP1
Log Path: /usr/iplanet/servers/https-company/logs
I have iPlanet log rotation enabled rotating files on a daily basis.
The rotated logs are NOT compressed & are taking up too much space.
I... (7 Replies)
Discussion started by: zachs
7 Replies
8. Shell Programming and Scripting
I have a qnap TS259 that is running ubuntu. Have successfully setup back scripts that are initiated by cron.
I would like to create a couple scrypts that would operate on the recycle bins for both drives. Just want to be able to run the script manually that would walk through both directories... (13 Replies)
Discussion started by: mackconsult
13 Replies
9. Shell Programming and Scripting
I have written a script which generate one logfile on every sunday and thursday
I want to move the older log files into /tmp directory befor generating new one so i used mv command like
mv usr/sbin/appl/logfile.txt usr/sbin/appl/tmp
2) But when i move this file to /tmp it will... (1 Reply)
Discussion started by: Nakul_sh
1 Replies
10. UNIX for Dummies Questions & Answers
Hi,
I need a command for deleting all the compress files *.Z that are older than the current date - 5 days. Basically I have a directory where daily I meet some back up files and I want to remove automatically the ones 5 days (or more) older than the current date. How can I write a 'rm' command... (1 Reply)
Discussion started by: Francy
1 Replies
LEARN ABOUT CENTOS
pmdate
PMDATE(1) General Commands Manual PMDATE(1)
NAME
pmdate - display an offset date
SYNOPSIS
pmdate [ offset ... ] format
DESCRIPTION
pmdate displays the current date and/or time, with an optional offset.
An offset is specified with a leading sign (``+'' or ``-''), followed by an integer value, followed by one of the following ``scale'' spec-
ifiers;
S seconds
M minutes
H hours
d days
m months
y years
The output format follows the same rules as for date(1) and strftime(3).
For example, the following will display the date a week ago as DDMMYYYY;
pmdate -7d %d%m%Y
PCP ENVIRONMENT
Environment variables with the prefix PCP_ are used to parameterize the file and directory names used by PCP. On each installation, the
file /etc/pcp.conf contains the local values for these variables. The $PCP_CONF variable may be used to specify an alternative configura-
tion file, as described in pcp.conf(5).
SEE ALSO
date(1), strftime(3), pcp.conf(5) and pcp.env(5).
Performance Co-Pilot PCP PMDATE(1)