04-16-2012
Check number of files that were created before a date?
Hi all,
In a directory I have a lot of files created in history. However do I check the number of files that were created before a designated date?
Thanks
10 More Discussions You Might Find Interesting
1. Filesystems, Disks and Memory
Hi,
Would like to ask, which command is used to list all the files for specific date (says 1st May) and its size, for all files (including its subdirectory), in a mounted NFS disk to HP-UX.
I would like to check for the total files came into my disk on 1st May.
Very much appreciating your... (2 Replies)
Discussion started by: Draculla
2 Replies
2. Solaris
Can you please let me know the command to list the files that are created before some date, this we want to use for the following
Eg: Move all the files that got created before 2006 to new folder in Solaris (3 Replies)
Discussion started by: csreenivas
3 Replies
3. UNIX for Dummies Questions & Answers
hi , i am trying to display the files created on a particular date. I have tried using find .-mtime +n but these files are created on november 6th 2007 , so i'm not sure of what the 'n' value should be. And the number of files created on that particular day are more than 5000 so i have to make a... (6 Replies)
Discussion started by: amit_kv1983
6 Replies
4. Shell Programming and Scripting
Hi All,
Could you please let me know if there is any one can help to create a shell script to remove some files which is the created date for them greate than 10 days (sysdate-10)
Please try to email me on email removed
Thanks in advance,
Murad (1 Reply)
Discussion started by: murad_fayez
1 Replies
5. Shell Programming and Scripting
There is a system logging a huge amount of data and we need to delete some of the older logs .I mean the files that are created before one week from today. Here is a listing of files that are sitting there:
/usr/WebSphere/AppServer/logs
# ls -l
-rw-r--r-- 1 root system 3740694 May... (5 Replies)
Discussion started by: moustafashawky
5 Replies
6. Shell Programming and Scripting
Hello everyone, I have this script here:
use Time::Local;
opendir (D, $ARGV) or die "Cant open";
foreach $file (readdir D)
{
$path = "$ARGV/$file";
next if ! -T $path;
$last_mod = (stat $path);
($sec,$min,$hour,$mday,$mon,$year,$wday) = localtime ($last_mod);
printf "%-15s:... (4 Replies)
Discussion started by: new bie
4 Replies
7. Shell Programming and Scripting
Guys i am having a bit of a trouble finding the creation date of a file. What i have to do is to redirect the output of a command (which i believed was ls -l but this command shows only the Modification time) into a file, which will contain all the files that were created on a certain date, for... (2 Replies)
Discussion started by: jimas13
2 Replies
8. Shell Programming and Scripting
Hi, I have a requirement to copy files from a windows network drive to a Linux server using shell script based on the last created date.
Ex:
FileName CreatedDate/Time
F1 05-01-2012 3:00 PM
F2 05-01-2012 3:15 PM
F3 05-01-2012 2:00 PM
When i run the shell script... (1 Reply)
Discussion started by: Lee_10
1 Replies
9. UNIX for Dummies Questions & Answers
My unix version is IBM AIX Version 6.1
I tried google my requirement and found the below answer,
find . -newermt “2012-06-15 08:13" ! -newermt “2012-06-15 18:20"
But newer command is not working in AIX version 6.1 unix
I have given my requirement below:
Input:
atr files:
... (1 Reply)
Discussion started by: yuvaa27
1 Replies
10. Shell Programming and Scripting
Hi All,
I am new in scripting and working in a project where we have RSyslog servers over CentOS v7 and more than 200 network devices are sending logs to each RSyslog servers. For each network devices individual folders create on the name of the each network devices IP addresses.The main... (7 Replies)
Discussion started by: Pinaki
7 Replies
LEARN ABOUT MOJAVE
savelog
SAVELOG(8) System Manager's Manual SAVELOG(8)
NAME
savelog - save a log file
SYNOPSIS
savelog [-m mode] [-u user] [-g group] [-t] [-p] [-c cycle] [-l] [-j] [-J] [-1 .. -9] [-C] [-d] [-l] [-r rolldir] [-n] [-q] [-D dateformat]
file ...
DESCRIPTION
The savelog command saves and optionally compresses old copies of files. Older versions of file are named:
file.<number><compress_suffix>
where <number> is the version number, 0 being the newest. Version numbers > 0 are compressed unless -l prevents it. Version number 0 is
not compressed because a process might still have file opened for I/O. Only cycle versions of the file are kept.
If the file does not exist and -t was given, it will be created.
For files that do exist and have lengths greater than zero, the following actions are performed:
1) Version numbered files are cycled. Version file.2 is moved to version file.3, version file.1 is moved to version file.2, and so on.
Finally version file.0 is moved to version file.1, and version file is deleted. Both compressed names and uncompressed names are
cycled, regardless of -l. Missing version files are ignored.
2) The new file.1 is compressed unless the -l flag was given. It is changed subject to the -m, -u, and -g flags.
3) The main file is moved to file.0.
4) If the -m, -u, -g, -t, or -p flags are given, then an empty file is created subject to the given flags. With the -p flag, the file
is created with the same owner, group, and permissions as before.
5) The new file.0 is changed subject to the -m, -u, and -g flags.
OPTIONS
-m mode
chmod the log files to mode, implies -t
-u user
chown log files to user, implies -t
-g group
chgrp log files to group, implies -t
-c cycle
Save cycle versions of the logfile (default: 7). The cycle count must be at least 2.
-t touch new logfile into existence
-l don't compress any log files (default: do compress)
-p preserve owner, group, and permissions of logfile
-j compress with bzip2 instead of gzip
-J compress with xz instead of gzip
For xz no strength option is set, and xz decides on the default based on the total amount of physical RAM. Note that xz can use a
very large amount of memory for the higher compression levels.
-1 .. -9
compression strength or memory usage (default: 9, except for xz)
-C force cleanup of cycled logfiles
-d use standard date for rolling
-D dateformat
override date format, in the syntax understood by the date(1) command
-r use rolldir instead of . to roll files
-n do not rotate empty files
-q be quiet
BUGS
If a process is still writing to file.0, and savelog moves it to file.1 and compresses it, data could be lost.
SEE ALSO
logrotate(8)
Debian 30 Dec 2017 SAVELOG(8)