The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 06-26-2008
PilotGoose PilotGoose is offline
Registered User
  
 

Join Date: Jun 2008
Posts: 2
Strange behaviour from script in crontab

Apologies if this has been mentioned elsewhere, my search skills may be lacking somewhat today.

I have a script that does the following (as a test):

Code:
find . -name "*.txt" -exec file {} \; >>$sFullFilePath
Now, the variable is set up up correctly in the script too. When I run the script myself, the file pointed at in $sFullFilePath is populated correctly.

However, when this is run using crontab on the identical directory (debug code proves this), it just creates an empty file.

When I look at the stack, it doesn't mention the output. Is crontab treating it as 2 seperate lines? The script starts with #!/bin/bash, so why should it act differently?

<is confused>