LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-09-2014, 10:58 PM   #1
Mitiraj
LQ Newbie
 
Registered: Aug 2014
Posts: 10

Rep: Reputation: Disabled
Delete older files using Shell script


Hi All,

I am trying to delete older files through the shell script and i am trying the below command which is not working. Pls advise

Code:
 
/usr/bin/find /ora/b1/fast_recovery_area/`echo "$ORACLE_SID" | tr 'a-z' 'A-Z'`/backupset/ -type f -mtime +3 -exec /bin/rm {} \ ;
 
Old 09-10-2014, 02:35 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,332
Blog Entries: 55

Rep: Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533
"not working" isn't a technical analysis of the problem:
- instead of using 'rm' use 'echo'. Then show us the result.
- note find these days has "-delete" itself.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Delete backups older than 7 days through shell script Rk_Raj Linux - Newbie 4 04-09-2013 03:47 AM
How to delete two days older files through script azheruddin Linux - Newbie 4 01-08-2013 01:18 PM
Script to delete older files not running . linuxlover.chaitanya Linux - Newbie 10 01-12-2009 02:27 AM
Script help - delete files older than 45 days but exclude the system files jojothedogboy Linux - Software 3 06-13-2008 04:43 PM
script to auto delete files older than X days nocnoc Programming 17 12-06-2006 09:30 AM


All times are GMT -5. The time now is 08:13 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration