Today (Saturday) We will make some minor tuning adjustments to MySQL.

You may experience 2 up to 10 seconds "glitch time" when we restart MySQL. We expect to make these adjustments around 1AM Eastern Daylight Saving Time (EDT) US.


How to delete all the files older than a date?


 
Thread Tools Search this Thread
# 1  
How to delete all the files older than a date?

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 for doing that?
Thanks!
 

|
Thread Tools Search this Thread
Search this Thread:
Advanced Search

More UNIX and Linux Forum Topics You Might Find Helpful
Move log files with date and delete older than 3 weeks
Nakul_sh
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...... Shell Programming and Scripting
1
Shell Programming and Scripting
Delete log files content older than 30 days and append the lastest date log file date
sreekumarhari
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...... Shell Programming and Scripting
2
Shell Programming and Scripting
Delete files older than X days.
Nagaraja Akkiva
Hi All, I am using below code to delete files older than 2 days. In case if there are no files, I should log an error saying no files to delete. Please let me know, How I can achive this. find /path/*.xml -mtime +2 Thanks and Regards Nagaraja.... Shell Programming and Scripting
3
Shell Programming and Scripting
Delete files older than 3 months.(read date from the name of the file)
bhagat.singh-j
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... Shell Programming and Scripting
3
Shell Programming and Scripting
How can I delete files older than 7 days?
odogbolu98
I will like to write a script that delete all files that are older than 7 days in a directory and it's subdirectories. Can any one help me out witht the magic command or script? Thanks in advance, Odogboly98:confused:... UNIX for Dummies Questions & Answers
3
UNIX for Dummies Questions & Answers

Featured Tech Videos