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



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Cron not running garric UNIX for Advanced & Expert Users 6 04-11-2008 08:32 AM
cron job is not running Suguna UNIX for Advanced & Expert Users 3 09-28-2006 09:11 AM
Cron Job Not Running nag_sundaram HP-UX 1 10-17-2005 10:38 AM
running cron jobs ted Shell Programming and Scripting 1 05-19-2004 12:35 PM
not running in cron ajnabi UNIX for Advanced & Expert Users 4 07-11-2003 02:35 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 07-11-2007
beisaikong beisaikong is offline
Registered User
  
 

Join Date: Jul 2007
Posts: 1
Cron not running .. please help

i have a simple script that ftp a file out, manually running it works fine.

#!/bin/sh
ftp 152.226.69.48 << cmd
bin
get applicant_vw.txt
quit
cmd

but when I cron it,

14 9 * * * /opt/home/XXX/XXX/dailyjob.sh > /opt/home/XXX/XXX/cronlog.txt

seems that it was executed because i can see the cronlog.txt but nothing in it.

anyone knows why ?

thanks
  #2 (permalink)  
Old 07-11-2007
porter porter is offline Forum Advisor  
Registered User
  
 

Join Date: Jan 2007
Posts: 2,965
Add a couple of lines to the script that creates and writes to a well known file that the program is running.

echo $PATH >/opt/home/XXX/XXX/debug.txt
which ftp >>/opt/home/XXX/XXX/debug.txt
  #3 (permalink)  
Old 07-12-2007
psiva_arul's Avatar
psiva_arul psiva_arul is offline
Registered User
  
 

Join Date: Jul 2007
Location: Bangalore, India
Posts: 97
Hi beisaikong,

Once add your file into cron table then you should compile the cron table then only it will take to execute your new added script.

so check it out the below command to add the new script and execute the script via cron.

$ crontab -l > crontxt.txt
Created new txt in your current directory then you can add you script and save it the txt file.
$ crontab < crontxt.txt
Moved the updated txtcron file into cron table file.
$ . ./crontab
compile the updated cron table.
or you can use the below command also.
or . ./crontxt.txt

then you see the output of the file in correct time of script running. if you want see the out put of the file you can create on log file and redirected the output of the script to the log file. then you can see the log file.

let me know if you have further querys.


Thanks,
Siva.P
Bangalore
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 05:00 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0