Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Remove files - using date range input 4

Status
Not open for further replies.

nrastogi

Programmer
Jul 19, 2002
52
US
Hi,

I like to accomplish the following sets of commands using the script -

cd /archive/users/
rm *090305*
rm *090405*
rm *090505*
....
....
rm *100205*


Basically, I like to remove all files that exists in /archive/users/.

I like to use a date range and delete all files from that date range.

I am new to scripting, please let me know exact steps to define parameter (date range) and how to use them in script.

Thanks much,
Nick
 
I am new to scripting
you've learned nothing in 4 years ? (cf thread822-421475)

What have you tried so far ?
 
lol PHV,

I'm amazed !!!
how do you find out ??
r u checking every single person posting here ??

anyway, great JOb !!!
 
Hey guys,

I need help. If you know the answer, then only respond!

Otherwise, no need to post anything in reply.

Thanks.
 
nrastogi,

I am also new to unix scripting(barely 1 year) but I have already written like 50+ scripts that is now running in our production machines. I usualy do my best to understand what all the unix commands by using book references and just using the man command. I still consider myself a neophyte in the scripting world but if something really stuns me in my scripting then I go to this wonderful forum to lay what I have done and then ask what I can improve upon. I don't ask
anyone in this forum to do my JOB! If you need training then I don't think this is the place.

In your case, a simple FIND comamnd could be the answer but then again that is yours to find out first.
 
You can search in this forum for "find date" (which, thankfully will NOT redirect you to a "Singles" site). This entry looked promissing, if I understand your needs:

thread822-957867



"Proof that there is intelligent life in Oregon. Well, Life anyway.
 
nrastogi said:
Hey guys,

I need help. If you know the answer, then only respond!

Otherwise, no need to post anything in reply.

Thanks.

nrastogi,
if you need help learning - pls do post.
if you need help doing your work - 'no need to post'

vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top