Sponsored Content
Operating Systems AIX How do i delete files older than 15 days in AIX? Post 302409048 by bakunin on Wednesday 31st of March 2010 05:33:58 AM
Old 03-31-2010
Quote:
Originally Posted by ross.mather
You also have a wild card in the find path,
This is correct and i wonder if wildcards in the path are supported at all. Maybe this is just working because some strange side effect.

"Searching and googling" should have revealed up to now that "del" is not a UNIX command at all. I did try and entered "delete files unix" into google, this was the first link to come up: how to delete files.

bakunin
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

delete files older than 7 days

can anyone tell me how I would write a script in ksh on AIX that will delete files in a directory older than 7 days? (1 Reply)
Discussion started by: lesstjm
1 Replies

2. UNIX for Dummies Questions & Answers

How can I delete files older than 7 days?

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: (3 Replies)
Discussion started by: odogbolu98
3 Replies

3. Shell Programming and Scripting

delete files and folders older than 3 days

find /basedirectory -type f -mtime +3 >> /tmp/tempfile find /basedirectory -type d -mtime +3 >> /tmp/tempfile mailx -s "List of removed files and folders" myemail@domain.com < /tmp/te mpfile rm /tmp/tempfile find /basedirectory -type f -mtime +3 -exec rm {} \; find /basedirectory -type d... (7 Replies)
Discussion started by: melanie_pfefer
7 Replies

4. UNIX for Dummies Questions & Answers

Delete files older than 30 days

This is driving me crazy. How can I delete files in a specifc directory that are over 30 days old? Thanks in advance. (3 Replies)
Discussion started by: tlphillips
3 Replies

5. Shell Programming and Scripting

Delete files older than certain days - Wrong !!!

Guys, I had raised a question about deleting files older than today in a specific directory and i got this as an answer find ${ARCH_DEST}/*.gz -mtime +0 -exec rm -f {} \; What happens when there aren't files that meet this criteria ? Can it delete any other directories ? I had a shocking... (22 Replies)
Discussion started by: kamathg
22 Replies

6. Shell Programming and Scripting

delete files more than 15 days older

i have to delete files which are older than 15 days or more except the ones in the directory Current and also *.sh files i have found the command for files 15 days or more older find . -type f -mtime +15 -exec ls -ltr {} \; but how to implement the logic to avoid directory Current and also... (3 Replies)
Discussion started by: ali560045
3 Replies

7. Solaris

Delete files older than 30 days

Hi all, I want to delete log files with extension .log which are older than 30 days. How to delete those files? Operating system -- Sun solaris 10 Your input is highly appreciated. Thanks in advance. Regards, Williams (2 Replies)
Discussion started by: William1482
2 Replies

8. Shell Programming and Scripting

Delete files older than X days.

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. (3 Replies)
Discussion started by: Nagaraja Akkiva
3 Replies

9. Shell Programming and Scripting

Delete 5 days older files from sftp

As one of our requirement was to connect to remote Linux server through SFTP connection and delete some files which are older than 7 days. I used the below piece of code for that, SFTP_CONNECTION=`sftp user_id@host ... cd DESIRED_DIR; find /path/to/files* -mtime +5 -exec rm -rf {} \;... (1 Reply)
Discussion started by: ATWC
1 Replies
AUTOTRASH(1)						      General Commands Manual						      AUTOTRASH(1)

NAME
autotrash -- program to automatically purge old files from the FreeDesktop.org trash SYNOPSIS
autotrash [-d purge_n_days_old] autotrash [--delete number_of_megabytes_to_purge] autotrash [--keep-free number_of_megabytes_to_free] DESCRIPTION
autotrash is a program that looks in a FreeDesktop.org Trash folder for information on it's contents and then purges a part of the trash depending on the options. The most common option is -d, which will purge files that have been in the trash for more then a given number of days. The option --delete will remove at least the given number of megabytes from the trash, removing the oldest trash first. Using --keep-free will make sure at least the given number of megabytes of free space is available, by automatically setting --delete to the right value. For example, to keep at least a 1GB of free space, removing files from the trash if needed, use autotrash --keep-free 1024 . OPTIONS
This program follows the usual GNU command line syntax, with long options starting with two dashes (`-'). -h --help Show a summary of options. -d DAYS --days DAYS Purge files older than DAYS number of days. -T PATH --trash-path PATH Use the given path as the location of the Trash directory, instead of the default: ~/.local/share/Trash . --max-free M Only purge files if there is less than M megabytes of free space left at the trash location. As an example, if you set this to 1024, then autotrash will only start to work if there is less than 1GB of free space in the trash. Till that time, autotrash will just exit normally without scanning the Trash directory. If unsure, try running autotrash with --dry-run and --verbose to see the effect. --delete M Purge at least M megabytes, deleting oldest trash addition first. It uses trash entries, NOT individual files. This means that if your oldest trashed item is a 1GB directory, and you request at least 10MB to be removed (M=10), autotrash will remove 1GB. If unsure, try running autotrash with both --dry-run and --stat to see the effect. --min-free M --keep-free M Make sure there is a minimum of M megabytes of free space. If there is less free space, set --delete to the difference between M and the amount of free space. If unsure, try running autotrash with --dry-run and --verbose to see the effect. -D REGEX --delete-first REGEX Purge any file which matches REGEX first, regardless of it's time-stamp. REGEX must be a valid regular expression. If this option is used multiple times, the files matching the first regular expression are deleted first, then the second etc. Example, delete any *.avi files first, then by age: --delete-first '.*.avi' -v --verbose Output information on what is happening and why. -q --quiet Only output warnings. --check Report .trashinfo files that point to a non-existing file. This will only happen with a broken Trashcan. It is left up to the user to actually do something with this information. These files will be removed as soon as the mentioned file would be removed by autotrash. --dry-run Only list what would be done, but actually do nothing. --stat Show the number, and total size of files involved. -V --version Show the version of program. EXAMPLES
Examples of program use. autotrash -d 30 Purge any file that has been in the trash for more then 30 days. autotrash --max-free 1024 -d 30 Only purge files from the trash if there is less than 1GB of space left on the trash filesystem. If so, only trash files that are older than 30 days. autotrash --min-free 2048 Purge files from trash, oldest first, till there is at least 2GB of space on the trash filesystem. There is no restriction on how old trashed files are. autotrash --min-free 2048 -D '.*.bak' -D '.*.avi' Purge files from trash till there is at least 2GB of space on the trash filesystem. If we need to remove files, make sure we remove *.bak files first, then all *.avi files and after that the oldest to the newest. There is no restriction on how old trashed files can get. Please note that '.*.bak' and '.*.avi' are regular expressions and not glob patterns. Given that they are regular expressions, using -D '.*.(png|gif|jpg|jpeg)' will match images with any of the given extensions. autotrash --max-free 4000 --min-free 2048 -d 30 Start reading the trash if there is less than 4000MB of free space, then start keeping an eye on. At that point, remove files older than 30 days and if there is less than 2GB of free space after that remove even newer files. @hourly /usr/bin/autotrash --max-free 4000 --min-free 2048 -d 30 Experienced users should consider adding autotrash as a crontab entry, using crontab -e and adding the line above. AUTHOR
This manual page was written by A. Bram Neijt bram@neijt.nl for the Debian system (and may be used by others). Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License, Version 3 or any later version published by the Free Software Foundation. On Debian systems, the complete text of the GNU General Public License can be found in /usr/share/common-licenses/GPL. AUTOTRASH(1)
All times are GMT -4. The time now is 11:15 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy