find: /home/Upload/*: No such file or directory
I am getting a find error when I run
for FILE in `find /home/Upload/* -prune -type f -newer TIMEFILE`
do
I need to run this job every 10 minutes to upload any new files that were added. Is there an easy way to prevent this?
Thanks
I am now running into the issue of a how can I verify that a file has finished downloading via ftp before I run an awk script against it?
How does awk handle this?
Thanks
> /dev/null 2>&1
I can suppress all errors but I might miss a legitimate error.
2> /tmp/file
var=$(wc -l /tmp/file)
if [ $var -gt 0 ]; then cat /tmp/file | mail -s "copy job error" your@e.mail ; rm /tmp/file; fi
or generate an error log with timestamps
Thanks funsen,
I am confused as to how it fits together.
I can see running the cron job and writing standard error to a temp file on the cron job.
2> /tmp/file
What I don't understand when not to fire the awk script if there is an error.
var=$(wc -l /tmp/file)
if [ $var -gt 0 ] then cat /tmp/file | mail -s "copy job error" your@e.mail ; rm
/tmp/file; fi
Thanks again for replying
if /tmp/file is not empty, which means an error occured, you get a mail, if not you get nothing - this can cause problems, because you don't know if the script didn't run at all
the wc -l is not needed, just wc works too, or you can just check if the file exists with "if [ -f /tmp/file ]; then ....
aigles
February 6, 2007, 9:14am
7