If you want to run in commands then following you could use.
So wanted to mention here first kindly run the hashed commands to check if the results are coming up to the mark and once you are satisfied then only run the commands written after Actual.
Also always run the 2 weeks before command(Actual 1st) firstly else if you run command for 1 week(Actual 2nd) before week files then it will delete all the files before 2 weeks before files also comes under same category too.
Kindly do let me know if this helps you.
NOTE: You could mention path also for command else it will take the current directory where you are executing the command and you could increase/decrease value of mindepth as per your requirement too.
I have directory where new sub directories and files being created every few minutes. The directories are like abc_date, def_date, ghi_date. I am looking to keep the latest 2 unique directories and delete everything else.
Here is what I have so far
This gives me unique names excluding the... (5 Replies)
Hi,
I'm Eddy from Belgium and I've the following problem.
I try to write a ksh script in AIX to tar, compress and remove the original *.wav files from the directory belgacom_sf_messages older than two days with the following commands.
The problem is that I do not find a good combination... (4 Replies)
I want to write a shell script that deletes all log files in a directory that are older than 30 days except for 3 files:
I am using the following command:
find /tmp/logs -name "*.log" -mtime +30 -exec rm -f {} \;But this command deletes all the log files.
How can i modify this script that... (5 Replies)
i am using HP-UX OS......
delete logs older than 60 days
find -mtime +60 | grep -i '.*log' | xargs rm
-mtime is nt available in HP-UX, pls tell me other option ? (2 Replies)
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)
hi i need a script to delete the files older than 2 days...
if my input is say in a folder versions
A_14122012.txt
A_15122012.txt
A_16122012.txt
A_17122012.txt
i want my output to be
A_16122012.txt
A_17122012.txt
thanks in advance
hemanth saikumar. (2 Replies)
hello everyone.
in /opt/abc every night there is a new folder created. in that folder there is aseries of files created for that day.
i would like to run a script every Sunday night at 02:00 to compress each file separately (preserving its name) who is older than 2 days.
i have found this... (2 Replies)
Discussion started by: atux
2 Replies
LEARN ABOUT MOJAVE
print
RUN-MAILCAP(1) Run Mailcap Programs RUN-MAILCAP(1)NAME
run-mailcap, view, see, edit, compose, print - execute programs via entries in the mailcap file
SYNOPSIS
run-mailcap --action=ACTION [--option[=value]] [MIME-TYPE:[ENCODING:]]FILE [...]
The see, edit, compose and print versions are just aliases that default to the view, edit, compose, and print actions (respectively).
DESCRIPTION
run-mailcap (or any of its aliases) will use the given action to process each mime-type/file in turn. Each file is specified as its mime-
type, its encoding (e.g. compression), and filename together, separated by colons. If the mime-type is omitted, an attempt to determine
the type is made by trying to match the file's extension with those in the mime.types files. If no mime-type is found, a last attempt will
be done by running the file command, if available. If the encoding is omitted, it will also be determined from the file's extensions.
Currently supported encodings are gzip (.gz), bzip2 (.bz2), xz (.xz), and compress (.Z). A filename of "-" can be used to mean "standard
input", but then a mime-type must be specified.
Both the user's files (~/.mailcap; ~/.mime.types) and the system files (/etc/mailcap; /etc/mime.types) are searched in turn for informa-
tion.
EXAMPLES
see picture.jpg
print output.ps.gz
compose text/html:index.htm
extract-mail-attachment msg.txt | see image/tiff:gzip:-
OPTIONS
All options are in the form --<opt>=<value>.
--action=<action>
Performs the specified action on the files. Valid actions are view, cat (uses only "copiousoutput" rules and sends output to STD-
OUT) , compose, composetyped, edit and print. If no action is specified, the action will be determined by how the program was
called.
--debug
Turns on extra information to find out what is happening.
--nopager
Ignores any "copiousoutput" directive and sends output to STDOUT.
--norun
Displays the found command without actually executing it.
SECURITY
A temporary copy of the file is opened if the file name matches the Perl regular expresssion "[^[:alnum:],.:/@%^+=_-]", in order to protect
from the injection of shell commands, and to make sure that the name can always be displayed in the current locale. In addition, the file
is opened using its absolute path to prevent the injection of command-line arguments, for instance using file names starting with dashes.
SEE ALSO file(1)mailcap(5)mailcap.order(5)update-mime(8)AUTHOR
run-mailcap (and its aliases) was written by Brian White <bcwhite@pobox.com>.
COPYRIGHT
run-mailcap (and its aliases) is in the public domain (the only true "free").
Debian Project 1st Jan 2008 RUN-MAILCAP(1)