Sponsored Content
Top Forums UNIX for Advanced & Expert Users Crontab Error - creating zero byte log file Post 302363711 by DSDexter on Wednesday 21st of October 2009 06:15:18 AM
Old 10-21-2009
Crontab Error - creating zero byte log file

Hi,

I am trying to run a shell script using the crontab scheduler, and I am redirecting the log of the script output to some temp log file using the following command.

Code:
sh somescript.sh 1> /location/somefile.log

Evrytime the cronjob triggers this script, It creates a zero byte file in the location specified. I also tried with

Code:
sh somescript.sh > /location/somefile.log

But no luck. If I run a simple command like

Code:
rm -rf <somefile>

then this command is running sucessfully by cron. But why is it not creating the log of the script that has been run? Any help will be higly appreciated.

Last edited by pludi; 10-21-2009 at 08:55 AM.. Reason: code tags please...
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help with a shell script for creating a log file

I have a schell script that runs continously on an AIX system. It is actually started from another shell script with the "ksh -x" command and then I just write the output to a log file. This causes the log files to be filled with mostly useless information. I would like to modify this script to... (2 Replies)
Discussion started by: heprox
2 Replies

2. Shell Programming and Scripting

help with creating new log file

Hello, The problem I am having now is... daily log file (xxxx.0228) exceeds it's max limit, stops logging and brings the daemon down. It won't start the daemon untill a new log file is created which happens at midnight. Once new daily log file starts, it brings up the daemon back up and starts... (0 Replies)
Discussion started by: john89011
0 Replies

3. Shell Programming and Scripting

crontab is not creating runtime files which are in script..

this is the output i am getting here.. cp: cannot create /wls_domains/eoigw/eoigwsA/deliv/cron/MailingScript/eoigwsA_Health_Status_Report.html: Permission denied /wls_domains/eoigw/eoigwsA/deliv/cron/MailingScript/ /wls_domains/eoigw/eoigwsA/deliv/cron/MailingScript/GenerateReport.sh:... (6 Replies)
Discussion started by: surekha268
6 Replies

4. Shell Programming and Scripting

Check if 2 files are identical byte-to-byte?

In my server migration requirement, I need to compare if one file on old server is exactly the same as the corresponding file on the new server. For diff and comm, the inputs need to be sorted. But I do not want to disturb the content of the file and need to find byte-to-byte match. Please... (4 Replies)
Discussion started by: krishmaths
4 Replies

5. Shell Programming and Scripting

Remove a byte(Last byte from the last line)

Hi All Can anyone please suggest me how to remove the last byte from a falt file .This is from the last line's last BYTE. Please suggest me something. Thank's and regards Vinay (1 Reply)
Discussion started by: vinayrao
1 Replies

6. Shell Programming and Scripting

Shell Script to grep Job File name and Log File name from crontab -l

Hello, I am new to shell scripting. I need to write a shell script where i can grep the name of file ie. .sh file and log file from crontab -l. #51 18 * * * /home/oracle/refresh/refresh_ug634.sh > /home/oracle/refresh/refresh_ug634.sh.log 2>&1 #40 17 * * * /home/oracle/refresh/refresh_ux634.sh... (1 Reply)
Discussion started by: guptra
1 Replies

7. Shell Programming and Scripting

crontab not creating text file

while running the following code in ssh crontab, Its running successfully but its not creating text file IFC1.txt, file1.txt, file2.txt while running manually its working. please help me #!/bin/ksh hostname > file1.txt 2>/dev/null hostname >> file1.txt 2>/dev/null sudo df -h | grep... (2 Replies)
Discussion started by: elango963
2 Replies

8. UNIX for Dummies Questions & Answers

Crontab Logfile Not Creating

I have a script file (fmlist.sh), i need the output of this script to write to a logfile (Mod_Alm_log.txt). If i execute the below manually it works, but when using in crontab the file is empty. cd /home/dreid12/als/Modernization && ./fmlist.sh > Mod_Alm_log.txt Any ideas? This is unix on a... (1 Reply)
Discussion started by: mytouchsr
1 Replies

9. Shell Programming and Scripting

Log file being not generated in crontab

My shell script it.sh #!/bin/sh ORACLE_HOME=/var/opt/oracle/product/10g; export ORACLE_HOME PATH=$PATH:$ORACLE_HOME/bin:/bin:/usr/bin; export PATH today=`date "+%m-%d-%Y %H:%M:%S"`; export today CUR_DIR=$1; export CUR_DIR LOG_FILE=error.log; export LOG_FILE # Direct script output to... (4 Replies)
Discussion started by: rafa_fed2
4 Replies

10. UNIX for Dummies Questions & Answers

Log file generation from crontab

Hi All, Like to enquire whether is it possible for me to append another log file(log2.lst) using my below crontab? I will need to have 2 log files generated; one to collect the daily appended output and another log file that contains only the daily output. Original Code: 00 01 * * *... (2 Replies)
Discussion started by: snowfrost88
2 Replies
ICECREAM(1)						      Icecream User's Manual						       ICECREAM(1)

NAME
scheduler - Icecream scheduler SYNOPSIS
scheduler [-n | --netname name] [-p | --port port] [-h | --help] [-l | --log-file file] [-d | --daemonize] [-r | --allow-run-as-user] [-v [v [v]]] DESCRIPTION
The Icecream scheduler is the central instance of an Icecream compile network. It distributes the compile jobs and provides the data for the monitors. OPTIONS
-n, --netname netname The name of the Icecream network the scheduler controls. -p, --port port IP port the scheduler uses. -h, --help Print help message. -l, --log-file logfile Name of file where log output is written to. -d, --daemonize Detach daemon from shell. -v, -vv, -vvv Control verbosity of daemon. The more v the more verbose. -r, --allow-run-as-user Force running the scheduler with user rights. Usually you will need to run the scheduler with root rights. SEE ALSO
icecream, scheduler, iceccd, icemon AUTHOR
Cornelius Schumacher Icecream April 21th, 2005 ICECREAM(1)
All times are GMT -4. The time now is 03:21 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy