[NTLUG:Discuss] How to get mv to not report when there are no files?
Fred James
fredjame at fredjame.cnc.net
Tue Nov 6 10:06:20 CST 2007
Neil Aggarwal wrote:
>Hello:
>
>I have a cron job with this command:
>mv /home/johnc/* /var/www/html/incoming
>
>If there is a file in the /home/johnc directory, I get
>no output, but when the directory is empty, I get this
>notification to the root email account:
>
>mv: cannot stat `/home/johnc/*': No such file or directory
>
>This job runs every 5 minutes so this is annoying.
>
>Is there a way to supress that output?
>
>Thanks,
> Neil
>
>
Neil Aggarwal
mv /home/johnc/* /var/www/html/incoming 2> /dev/null
... redirects the stderr to /dev/null (the special file that never contains anything no matter how much you put into it).
On my system that would man null, for more information
Regards
Fred James
More information about the Discuss
mailing list