Find command with standard error output and mail error file
Hi Linux Folks:
We have the following issue:
We make everyday a DB Mysql backup on Linux redhat Enterprise. We are using a bash shell script (and putting it in the crontab) to execute it automatically everyday. We added a line to this script telling, once the backup has completed, to find old backup files (stored on hard disk after each backup) older than x days to remove them. We use the find command (search for file type) with the mtime option and in combination with rm command. Everything runs ok but we also want to add some new code to the same line: If find command cannot find anything or fails, for example if it cannot delete file or fails, send the error message (standard error output) to an error file (like error000001 and increasing) and mail the errorxxxx file to an email address for example to email@example.com. What would be the code for this issue to add it to our find command in the same bash shell script??
please help, thx in advance
and look up on the WEB
shell redirection stderr
|All times are GMT -5. The time now is 11:22 PM.|