LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-13-2013, 03:00 AM   #1
miros84
Member
 
Registered: Aug 2009
Location: Spain
Distribution: Debian stable, squeeze
Posts: 501

Rep: Reputation: 31
Find - verbose mode?


Hi,

I have a cronjob that create a log and execute that script.

Code:
find /etc/test -type f -mtime +10 -delete
But I noted that it doesnot write in log file. I was looking in man page but I didnot find a verbose mode option. How can I change that script so I can see what was delete in log flie?


--------------------------------------------
(I dont ask how to create log file. I created it yet and did it in crontab * * * * * something someting > file.log)
 
Old 02-13-2013, 03:13 AM   #2
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981
Just add -print before -delete. The result of the search will be printed out and then deleted.
Code:
find /etc/test -type f -mtime +10 -print -delete
 
1 members found this post helpful.
Old 02-13-2013, 04:39 AM   #3
miros84
Member
 
Registered: Aug 2009
Location: Spain
Distribution: Debian stable, squeeze
Posts: 501

Original Poster
Rep: Reputation: 31
Hi colucix,

Thank you for your soluition. I was looking for verbose or -v and I didnot find. But I see -print is what I need. I added to my script.

Thanks
 
  


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
dd verbose mode? sausagejohnson Linux - General 10 06-20-2017 06:15 AM
bootsplash not working >> always using verbose mode CopyrightPhilly Linux - Software 1 01-12-2007 03:28 AM
pc always boot in verbose mode...help rgistered SUSE / openSUSE 3 02-27-2006 10:21 AM
Verbose to Silent Mode Very Maqbool Linux - Software 2 07-16-2005 03:34 AM
Permanent verbose mode for startup Fnurr Mandriva 4 02-07-2005 04:15 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:13 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
Open Source Consulting | Domain Registration