03-22-2007
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I have a shell script to find files older than 'X' days ($2) in directory path ($1) and delete them.
Like this:
my_file_remover.sh /usr/home/c 90
Now, I need to modify this script and add it in CRON, so that it checks other directories also.
Like:
my_file_remover.sh /usr/home/c... (3 Replies)
Discussion started by: guruparan18
3 Replies
2. Shell Programming and Scripting
Hi,
I am trying to write a script that will use ls on a directory and list the files one at a time and their size. If the size is 0 i want it to ask me if I want to delete it (yes or no). If I say yes, I want it to delete but it won't know what the file name is just from running from the script.... (2 Replies)
Discussion started by: akeenabawa
2 Replies
3. Shell Programming and Scripting
Can any one please help me in deleting all the Files over 7 days from sub-directories A, B, C...
Top-Directory
Sub-Directory-A
File-1
File-2
.....
File-n
Sub-Directory-B
File-1
File-2
.....
File-n
Sub-Directory-C
File-1
... (1 Reply)
Discussion started by: sureshcisco
1 Replies
4. Red Hat
Hi,
I have dummies questions:
My script here can find the files in any directories older than 30 days then it will delete the files but not the directories. I would like to also be able to delete the directories that hold old files more than 30 days not just the files itself.
find . -type f... (2 Replies)
Discussion started by: lamoul
2 Replies
5. UNIX for Advanced & Expert Users
Hi All,
We have a requirement to recursively delete the directories and its subdirectories older than 60 days based on timestamp (folder creation timestamp)under certain directory. However it has some specific requirements.
The directories will continue to be there upto any depth.
the... (0 Replies)
Discussion started by: rcvasu
0 Replies
6. Homework & Coursework Questions
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
Need to make a script, to remove all empty files and folders from current category.
It also should show the name... (2 Replies)
Discussion started by: Itixop
2 Replies
7. Shell Programming and Scripting
I have a task, I usually do manually, but with growing responsibilities I tend to forget to do this weekly, I want to write a script that automates this, but I cant seem to work it out in my head, I have the shell of it out, but need help, and you guys have helped me with EVERY problem I have... (5 Replies)
Discussion started by: gkelly1117
5 Replies
8. Shell Programming and Scripting
OS: SUNOS 5.10 i386
Hello guys I wrote a shell script in bash shell to delete the files less than 30 days old. The following is the script.
=======================================
#!/bin/bash
for dirs in `/clu04/oracle/directory_list.lst`
do
find $dirs -type f -mtime -30 -exec rm {} \;... (3 Replies)
Discussion started by: zacsparrow
3 Replies
9. Shell Programming and Scripting
Hello,
i have an dynamical apache_cache that I need to clean all days (older tant one day) with an unix command :
find /usr/IBM/HTTPServer/apache_cache/ -name '*' -mtime +1 -print0|xargs -0 rm -r --
but it didn't work.
Could you explain me why.
So I will put below all my script :... (13 Replies)
Discussion started by: steiner
13 Replies
10. UNIX for Beginners Questions & Answers
I wrote a shell script program that supposed to delete any directories and its files that begin with the same character string . The program is designed to delete directories and its files that are one day old or less and only the directories that begin with the same character string. The problem... (1 Reply)
Discussion started by: dellanicholson
1 Replies
PARTY(1) General Commands Manual PARTY(1)
NAME
party - set OS responses mode
SYNOPSIS
party ON|OFF|WHEREIS [ - ] dnv
DESCRIPTION
Operating systems being what they are, the admin people can easily grow tired of command responses that resemble dyslexic eugene-
speak filtered through Kernighan and Ritchie's collective back-brains. To alleviate this, we have included a slightly more
`casual' mode, in which the responses to all commands are first filtered through a customising routine (DUDE) , which makes them
sound a little more friendly while retaining their full information content (usually). The rooted(c) system prompt is changed to
`What now, dude?' and output from each command is terminated by `No problem, dude.'
OPTIONS
-v Verbose mode (ALL commands have a `verbose' mode). When this option is present, all filtered responses are preceeded by a
message: `This response has been parsed by the DUDE filter and is not intended to be some sort of sleazy come-on.'
-d Don't restart all processes after recompiling the /uselss/libs/eugene file (see below). This alows any important tasks to
complete beforehand.
-n Notify all users that they are about to be force-logged out and force-logged in again.
ON Activates the DUDE filter.
OFF De-activates the DUDE filter.
WHEREIS
Doesn't do anything, but we couldn't resist it.
EXAMPLES
%-) party on
What now, dude?
To compare the differing responses, here is output provided by the ispi -s command, with party OFF and party ON:
party OFF
line who why how long
==========================================================
000 rooted that's you, dweeb! epoch
----------------------------------------------------------
00F wp she's supposed to be 0:44:12
typing up the end of
financial year report,
but she's been doing her
resume when she thinks
no-one is watching
----------------------------------------------------------
014 maint playing games, as usual 0:51:16
party ON
Well, let's see who's on, eh? There's you, of course, on line 000 (Imagine that! Hahaha!) Oh look, on serIOus line 00F, it's that
cute little secretary - looks like she's lost her keyboard template again, she's been hitting the escape key for the past five minutes!
AND OF COURSE, the guys down in maintenance are playing `cosmic ballcrushers'. As usual. Well, who else, um, no-one really
interesting like, ya know, oh hang on, DTR is toggling on serIOus line 03D.. oh, no problem, it's that stuffed modem again. You want
maybe I should send some AMail to maintenance and get 'em to look at it? No problem, dude.
What now, dude?
FILES
/uselss/libs/bill&ted/DUDE
This is the pipe process, usually
started at system shoe, which lies
idle until party ON is issued.
/uselss/libs/eugene
Contains all of the ordinary, ho-hum
confusing computer - jargonese
responses which commands ordinarily
issue. Text file.
/uselss/libs/eugene.spoo
compiled version of the eugene file.
/ephemeral/eugene.chex
Checksum for the compiled eugene file.
SEE ALSO
crp(1), stuffio(2), doobrie(9), gouge(3), ftang(65534), wi(-1), edmond(29), jumpstart(2), vo_mit(992)
BUGS
The -n option can be slow.
If the n option is issued, some users in a wi editing session may not receive the `warning, restart imminent' message until after the
restart.
There is no way selectively to follow symbolic links.
Sunburne Computer, Inc. 9 October 1991
Aug 18, 1997 PARTY(1)