Sponsored Content
Top Forums Shell Programming and Scripting How do I prevent cron from returning errors on a file not found? Post 302105953 by goodmis on Monday 5th of February 2007 05:29:01 PM
Old 02-05-2007
How do I prevent cron from returning errors on a file not found?

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
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

errors when running a cron job

I am running some shell scripts through a foll cron job, the script works fine and there are no errors in the log file but I receive the following error in mail for the jobs: stty: no such device or address What does the above error indicate, here is the cron job: 0 22 * * 0... (2 Replies)
Discussion started by: knarayan
2 Replies

2. Shell Programming and Scripting

java errors when calling from cron

I am more or less new to using cron, and I am trying to automate a log cleaning system I have made. The system basically cleans through WWW logs that are mounted on an NFS and creates text files for entry into a local PostgreSQL DB. For the past year I have been running the various scripts and... (3 Replies)
Discussion started by: mntamago
3 Replies

3. Linux

Unable to send mail - but no errors found :-(

Hi Guys I am using this version of Linux box (as shown below). I am unable to send email from the box. But I am not getting any errors while sending email. :mad: Any idea what could be the reason? What entry should I check? :confused: $ uname -a Linux machine-name 2.4.21-144-smp4G #1... (6 Replies)
Discussion started by: csaha
6 Replies

4. Shell Programming and Scripting

prevent errors/warnings from being written to log file

i have this script which works fine but shows errors when it runs..these are more like warnings and the script runs fine.. i am on a sun machine.. i know it writes all the error messages to a master log file.. is there any way i can turn off these warnings/error messages and prevent them from being... (2 Replies)
Discussion started by: npatwardhan
2 Replies

5. UNIX for Advanced & Expert Users

How to prevent grep command from throwing a system trap if No match is found.

Hi How to prevent grep command from throwing a system trap(or returning error status) if No match is found in the specified file(s) ? Consider this simple shell script: #!/usr/bin/ksh trap 'STATUS=$?;set +x;echo;echo error $STATUS at line nb $LINENO executing :\ `sed -n... (2 Replies)
Discussion started by: cool.aquarian
2 Replies

6. UNIX for Dummies Questions & Answers

Loop on array variable returning error: 0 not found

I'm guessing i have a syntax error. I'm not sure it get's past the the while condition. I get an error 0 not found. Simple loop not sure what I'm doing wrong. #!/usr/bin/ksh set -A MtPtArray /u03 /u06 tUbound=${#MtPtArray } echo $tUbound i=0 while ($i -lt $tUbound) do print... (4 Replies)
Discussion started by: KME
4 Replies

7. Shell Programming and Scripting

Cron job to prevent simultaneous script

I'm using a shared server on Hostgator (Linux CentOS). I'm trying to set a cron job using the Control Panel that will check if its already running before starting a new one. I've tried the following... * * * * * && but I get this error emailed to me... /bin/sh: line 0: Any... (5 Replies)
Discussion started by: tech9821
5 Replies

8. Shell Programming and Scripting

Command not found errors when running csh script

I am trying to find the number of files whose name starts with uni. Below is the code but it is giving error. :confused: #!/bin/csh FILES_NAME ='files_list'; FILE_NAME_PATTERN = 'uni*'; NO_OF_FILES; ls -l $FILE_NAME_PATTERN > $FILES_NAME ; NO_OF_FILES = `wc -l $FILES_NAME`; echo... (3 Replies)
Discussion started by: hiten.r.chauhan
3 Replies

9. Shell Programming and Scripting

Ssh from a ksh returning not found message

Script name is test.ksh I know that that the ssh command is working properly, this can be verified by the value returned in respond variable. It is unique to the remote server _____________________________________________________ respond=$(ssh $remoteHost find... (3 Replies)
Discussion started by: Adagio
3 Replies

10. Programming

Expect script returning string following a found expect.

I'm fairly new to scripting so this might not be possible. I am using Expect with Cisco switches and need to capture the string after finding the expect request. For example, when I issue "show version" on a Nexus switch, I'm looking to capture the current firmware version: #show version ... (0 Replies)
Discussion started by: IBGaryA
0 Replies
Apache2::Upload(3pm)					User Contributed Perl Documentation				      Apache2::Upload(3pm)

NAME
Apache2::Upload - Methods for dealing with file uploads. SYNOPSIS
use Apache2::Upload; $req = Apache2::Request->new($r); $upload = $req->upload("foo"); $size = $upload->size; # three methods to get at the upload's contents ... slurp, fh, io $upload->slurp($slurp_data); read $upload->fh, $fh_data, $size; ok $slurp_data eq $fh_data; my $io = $upload->io; print while <$io>; DESCRIPTION
Apache2::Upload is a new module based on the original package included in Apache2::Request 1.X. Users requiring the upload API must now "use Apache2::Upload", which adds the "upload" method to Apache2::Request. Apache2::Upload is largely backwards-compatible with the original 1.X API. See the "PORTING from 1.X" section below for a list of known issues. This manpage documents the Apache2::Upload package. Apache2::Upload name $upload->name() The name of the HTML form element which generated the upload. filename $upload->filename() The (client-side) filename as submitted in the HTML form. Note: some agents will submit the file's full pathname, while others may submit just the basename. fh $upload->fh() Creates filehandle reference to the upload's spooled tempfile, which contains the full contents of the upload. io $upload->io() Creates a tied IO handle. This method is a more efficient version of "fh", but with "io" the handle ref returned is not seekable. It is tied to an APR::Request::Brigade object, so you may use the brigade API on the tied object if you want to manipulate the IO stream (beyond simply reading from it). The returned reference is actually an object which has "read" and "readline" methods available. However these methods are just syntactic sugar for the underlying "READ" and "READLINE" methods from APR::Request::Brigade. $io = $upload->io; print while $io->read($_); # equivalent to: tied(*$io)->READ($_) See READ and READLINE below for additional notes on their usage. bb $upload->bb() $upload->bb($set) Get/set the APR::Brigade which represents the upload's contents. size $upload->size() Returns the size of the upload in bytes. info $upload->info() $upload->info($set) Get/set the additional header information table for the uploaded file. Returns a hash reference tied to the APR::Table class. An optional $table argument can be passed to reassign the upload's internal (apr_table_t) info table to the one $table represents. my $info = $upload->info; while (my($hdr_name, $hdr_value) = each %$info) { # ... } # fetch upload's Content-Type header my $type = $upload->info->{"Content-type"}; type $upload->type() Returns the MIME type of the given Apache2::Upload object. my $type = $upload->type; #same as my $content_type = $upload->info->{"Content-Type"}; $content_type =~ s/;.*$//ms; link $upload->link() To avoid recopying the upload's internal tempfile brigade on a *nix-like system, link will create a hard link to it: my $upload = $req->upload('foo'); $upload->link("/path/to/newfile") or die sprintf "link from '%s' failed: $!", $upload->tempname; Typically the new name must lie on the same device and partition as the brigade's tempfile. If this or any other reason prevents the OS from linking the files, "link()" will instead copy the temporary file to the specified location. slurp $upload->slurp($contents) Reads the full contents of a file upload into the scalar argument. The return value is the length of the file. my $size = $upload->slurp($contents); tempname $upload->tempname() Provides the name of the spool file. my $tempname = $upload->tempname; APR
::Request::Brigade This class is derived from APR::Brigade, providing additional methods for TIEHANDLE, READ and READLINE. To be memory efficient, these methods delete buckets from the brigade as soon as their data is actually read, so you cannot "seek" on handles tied to this class. Such handles have semantics similar to that of a read-only socket. TIEHANDLE APR::Request::Brigade->TIEHANDLE($bb) Creates a copy of the bucket brigade represented by $bb, and blesses that copy into the APR::Request::Brigade class. This provides syntactic sugar for using perl's builtin "read", "readline", and "<>" operations on handles tied to this package: use Symbol; $fh = gensym; tie *$fh, "APR::Request:Brigade", $bb; print while <$fh>; READ $bb->READ($contents) $bb->READ($contents, $length) $bb->READ($contents, $length, $offset) Reads data from the brigade $bb into $contents. When omitted $length defaults to "-1", which reads the first bucket into $contents. A positive $length will read in $length bytes, or the remainder of the brigade, whichever is greater. $offset represents the index in $context to read the new data. READLINE $bb->READLINE() Returns the first line of data from the bride. Lines are terminated by linefeeds (the '12' character), but we may eventually use $/ instead. PORTING from 1.X o "$upload->next()" is no longer available; please use the "APR::Request::Param::Table" API when iterating over upload entries. o "info($header_name)" is replaced by "info($set)". o "type()" returns only the MIME-type portion of the Content-Type header. SEE ALSO
APR::Request::Param::Table, APR::Request::Error, Apache2::Request, APR::Table(3) COPYRIGHT
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. perl v5.10.1 2010-11-25 Apache2::Upload(3pm)
All times are GMT -4. The time now is 11:07 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy