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)
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)
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)
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)
Hi All
I want to remove the files with name like data*.csv from the directory older than 10 days.
If there is no files exists to remove older than 10 days, It should not do anything.
Thanks
Jo (9 Replies)
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 {} \;
bye... (2 Replies)
Discussion started by: ATWC
2 Replies
LEARN ABOUT OPENSOLARIS
dircmp
dircmp(1) User Commands dircmp(1)NAME
dircmp - directory comparison
SYNOPSIS
dircmp [-ds] [-w n] dir1 dir2
DESCRIPTION
The dircmp command examines dir1 and dir2 and generates various tabulated information about the contents of the directories. Listings of
files that are unique to each directory are generated for all the options. If no option is entered, a list is output indicating whether the
file names common to both directories have the same contents.
OPTIONS
The following options are supported:
-d Compares the contents of files with the same name in both directories and output a list telling what must be changed in the two
files to bring them into agreement. The list format is described in diff(1).
-s Suppresses messages about identical files.
-w n Changes the width of the output line to n characters. The default width is 72.
OPERANDS
The following operands are supported:
dir1 A path name of a directory to be compared.
dir2
USAGE
See largefile(5) for the description of the behavior of dircmp when encountering files greater than or equal to 2 Gbyte ( 2^31 bytes).
ENVIRONMENT VARIABLES
See environ(5) for descriptions of the following environment variables that affect the execution of dircmp: LC_COLLATE, LC_CTYPE, LC_MES-
SAGES, and NLSPATH.
EXIT STATUS
The following exit values are returned:
0 Successful completion.
>0 An error occurred. (Differences in directory contents are not considered errors.)
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWesu |
+-----------------------------+-----------------------------+
SEE ALSO cmp(1), diff(1), attributes(5), environ(5), largefile(5)SunOS 5.11 1 Feb 1995 dircmp(1)