LinuxQuestions.org
Help answer threads with 0 replies.
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 12-12-2013, 04:32 PM   #16
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-20-live-usb/ aix
Posts: 5,028

Rep: Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845

Quote:
Originally Posted by phinzola1 View Post
which rm gives me /bin/rm

No I dont want to redirect.I just want to delete the directories and its subdirectories completely.
I can see u use echo.I thought you said i must not use echo
i'm using echo to prevent it from removing important files on my pc (it is meant for testing purposes to show you that cron is running every 15 minutes).

can you please run this command and paste the result in your next response:
Code:
ll /opt/var/test/*BSC*
i dont mean to undermine your competence, but are you sure you are waiting until after 15, 30 or 45 minutes past the hour to check that the files are removed while using cron ?

edit: check it out... i modified my crontab to delete the file that was created 30 minutes ago:
Code:
[schneidz@hyper stuff]$ crontab -l
15,30,45 * * * *     /bin/rm -rf  /home/schneidz/cron.test
[schneidz@hyper stuff]$ ll /home/schneidz/cron.test
ls: cannot access /home/schneidz/cron.test: No such file or directory

Last edited by schneidz; 12-12-2013 at 04:45 PM.
 
Old 12-12-2013, 04:48 PM   #17
phinzola1
LQ Newbie
 
Registered: Dec 2013
Posts: 12

Original Poster
Rep: Reputation: Disabled
Below is what that command gives me.Now what i want is delete BSCSTA2 and its subdirectory NBSSLOCREQTOT

rw-r--r-- 1 dev dev 25152 Dec 12 22:54 1386882420_G20131212_2100_20131212_2200__OJMBC4_50_BSCSTAT2_NBSSLOCREQTOT__20131212215432647.csv
-rw-r--r-- 1 dev dev 25135 Dec 12 22:54 1386882420_G20131212_2100_20131212_2200__OJMBC4_51_BSCSTAT2_NBSSLOCREQTOT__20131212215432649.csv
 
Old 12-12-2013, 04:50 PM   #18
phinzola1
LQ Newbie
 
Registered: Dec 2013
Posts: 12

Original Poster
Rep: Reputation: Disabled
Linux raven-ETL1 2.6.18-128.el5 #1 SMP Wed Dec 17 11:41:38 EST 2008 x86_64 x86_64 x86_64 GNU/Linux
 
Old 12-12-2013, 04:51 PM   #19
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-20-live-usb/ aix
Posts: 5,028

Rep: Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845
^ i am wondering why the /opt/var/test/ is missing from the filenames (the ll command shouldve showed the /path/to/filenames to ensure the files you are trying to delete exist in the directory you are specifying).

also, NBSSLOCREQTOT isnt a subdirectory. in your exapmple 1386882420_G20131212_2100_20131212_2200__OJMBC4_50_BSCSTAT2_NBSSLOCREQTOT__20131212215432647.csv is one file name.

Last edited by schneidz; 12-12-2013 at 05:42 PM.
 
Old 12-12-2013, 04:55 PM   #20
phinzola1
LQ Newbie
 
Registered: Dec 2013
Posts: 12

Original Poster
Rep: Reputation: Disabled
Oh dont worry about that one.Its is not the actual path but as an example of the actual scenario.Of which the actual gives me this output.I didn't want to give you the actual coz its a live system of my customer.
 
Old 12-12-2013, 05:02 PM   #21
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-20-live-usb/ aix
Posts: 5,028

Rep: Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845Reputation: 845
what do you get when you type in whoami (i would assume you are logged in as dev. is it dev's crontab you are editing ?
try changing the crontab to this:
Code:
* * * * *      /bin/rm -rf /opt/var/test/*BSC* &> /opt/var/test/cron.test
i change the frequesncy of the command to every minute so we wouldnt have to wait long.
then
Code:
cat /opt/var/test/cron.test
paste this output in your next response.
 
Old 12-12-2013, 05:16 PM   #22
phinzola1
LQ Newbie
 
Registered: Dec 2013
Posts: 12

Original Poster
Rep: Reputation: Disabled
ok my friend.I will do that.But I am now sleeping its now 12:12 AM here.will continue later in the afternoon today
 
  


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
[SOLVED] BASH Help - Set multiple directories in variable cli Linux - Newbie 13 06-08-2013 12:50 AM
[SOLVED] Command for deleting file type from a directory and its subdirectories? Cinematography Linux - General 3 06-21-2012 06:58 PM
Find directories that have two subdirectories in them-- PLEASE help pierceogden Programming 6 04-06-2012 09:47 PM
Deleting remote directories on multiple hosts with a bash script zirtik Programming 6 04-16-2009 10:52 AM
copy directories and subdirectories Red Squirrel Linux - Newbie 2 03-06-2004 10:18 PM


All times are GMT -5. The time now is 10:42 AM.

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