Crontab Logfile Not Creating


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Crontab Logfile Not Creating
# 1  
Old 05-23-2013
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.

Code:
cd /home/dreid12/als/Modernization && ./fmlist.sh > Mod_Alm_log.txt

Any ideas? This is unix on a solaris system if that makes a difference.
# 2  
Old 05-23-2013
cron is dumb, we have a lot of posts on the subject, do a bit of search...
You issue is due to loack of environment settings... so do some search on our forum and correct, I am here to suggest more the way you use cron and logs:
If you wish to have only one log then your command:
Code:
cd /home/dreid12/als/Modernization && ./fmlist.sh > Mod_Alm_log.txt 2>&1

For cron depending of unix will complain ( Stdout and StdErr are not defined or are the same etc... the same goes if you execute your .profile to solve your environment, here it will complain depending of keyboard settings or Dsplay type e.g. Not a tty message...)
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Logfile monitoring with logfile replacement

Bonjour, I've wrote a script to monitor a logfile in realtime. It is working almost perfeclty except for two things. The script use the following technique : tail -fn0 $logfile | \ while read line ; do ... some stuff done First one, I'd like a way to end the monitoring script if a... (3 Replies)
Discussion started by: Warluck
3 Replies

2. Shell Programming and Scripting

Logs from logfile

Hi Team, Have to write a shell script to pick only 1 hr logs from the generated logfile and send it to other logfile. Thanks & Regards, Indu (3 Replies)
Discussion started by: indira_s
3 Replies

3. Homework & Coursework Questions

Creating a .profile, displaying system variables, and creating an alias

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Here is what I am supposed to do, word for word from my assignment page: 1. Create/modify and print a... (2 Replies)
Discussion started by: Jagst3r21
2 Replies

4. 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

5. Shell Programming and Scripting

looking for string in logfile

I have a shell script that used to look for a particular sting in the last line of a log file. Howeve this string now has moved to the 3rd or 4th line from bottom. Can anyone point me to how i easiest chage this one to look within the last frew lines (5 or so) for the particular string rather... (6 Replies)
Discussion started by: jjlinux
6 Replies

6. Shell Programming and Scripting

logfile parsing

I thought I was pretty handy with awk until I got this one. :) I'm trying to parse a log file where the events could have different delimiters (2 scripts is ok), the errors are spread over multiple lines, and I"m trying to figure out how to not read the same lines that have already been read. ... (1 Reply)
Discussion started by: linkslice
1 Replies

7. UNIX for Advanced & Expert Users

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. sh somescript.sh 1> /location/somefile.log Evrytime the cronjob triggers this script, It creates a zero byte file in the... (4 Replies)
Discussion started by: DSDexter
4 Replies

8. Shell Programming and Scripting

help needed with creating challenging bash script with creating directories

Hi, Can someone help me with creating a bash shell script. I need to create a script that gets a positive number n as an argument. The script must create n directories in the current directory with names like map_1, map_2 etcetera. Each directory must be contained within its predecessor. So... (7 Replies)
Discussion started by: I-1
7 Replies

9. 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

10. Shell Programming and Scripting

logfile

hi iam new of the ksh script.iwant in formation of how to call in logfile in ksh scripts. if the meaning in ksh. please help me thanks naveen.g (1 Reply)
Discussion started by: naveeng.81
1 Replies
Login or Register to Ask a Question