rm: cannot remove `*.html': No such file or directory
If you have a cron job that deletes files daily or on another schedule you probably don't want to get the email that tells you something like that. There's always the option of redirecting the output to
/dev/nullbut then you're screwed if there's any other errors that you actually want to know about.
Instead, use the
--forceflag of the rm program. That flag literally means ignore nonexistent files, never prompt. So instead of getting that cannot remove error, it will just go about business as usual.
Instead of the following to delete two types of files,
rm /path/to/*.html; rm /path/to/*.html.gz
Use the following to delete them and not have to worry if one type doesn't exist.
rm -f /path/to/*.html; rm -f /path/to/*.html.gz