Languages and Scripting

shell script to find files less than 30 days and send error to a log files

 
SBagheri
Occasional Advisor

shell script to find files less than 30 days and send error to a log files

hello

i want a script to find some files in a path like /backup  with .bk extensn and then send the error to a log file ......

thx for help..

1 REPLY 1
Dennis Handly
Acclaimed Contributor

Re: shell script to find files less than 30 days and send error to a log files

find /backup -name "*.bk" -mtime -30

 

>then send the error to a log file

 

What type of errors?  You can redirect stderr to the log file by adding to the end:

   >> logfile