[NTLUG:Discuss] How to get mv to not report when there are no files?

Stuart Johnston saj at thecommune.net
Tue Nov 6 18:21:10 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?

How about:

find /home/johnc/ && mv /home/johnc/* /var/www/html/incoming



More information about the Discuss mailing list