The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
AIX and cron logs filtering ?: /etc/cronlog.conf, /var/adm/cron/log Keith Johnson AIX 0 01-09-2008 04:32 PM
Script doesn't work, but commands inside work cheongww UNIX for Dummies Questions & Answers 2 11-14-2006 06:52 PM
Command doesn't work under cron ? bigjohn-nj Shell Programming and Scripting 4 01-20-2006 12:38 PM
script didn;t work in cron !!! @_@ stancwong Shell Programming and Scripting 2 10-04-2005 06:25 AM
Simple cron job won't work coregan UNIX for Dummies Questions & Answers 4 01-20-2004 01:22 AM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-20-2005
Registered User
 

Join Date: Dec 2004
Posts: 13
ncopy doesn't work from cron

Hello,

I have put the following command in a shell script:

ncopy /home/Selma/my_file server2\!INPUT/my_file userpassword

(server2 is the remote machine)

The script works fine when it is invoked manually, however when it is scheduled to be run from crontab ncopy doesn't work (all of the other commands work).

Do you know what might be the problem?

TIA,

Selma
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 01-20-2005
RTM's Avatar
RTM RTM is offline
Hog Hunter
 
Join Date: Apr 2002
Location: On my motorcycle
Posts: 3,039
Your problem is probably that you aren't putting in the path to ncopy. When running manually, you have a PATH variable (echo $PATH) which allows you to type in ncopy, and your PATH variable is used to find the ncopy command. When running in cron, your normal enviroment variables aren't there unless you specify them (or run your login profiles).

Use the which command to find where ncopy is ( $ which ncopy) - put the output into the script (it should come back with the correct path to ncopy). Always put the path in scripts - so you don't have these types of problems.
Reply With Quote
  #3 (permalink)  
Old 01-20-2005
Registered User
 

Join Date: Dec 2004
Posts: 13
Yes, that was the problem! Thank you very much for helping.
I had been aware that full paths are needed in cron, but I had only been including them for files, not the commands. Up until now

Thank you once again
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 01:33 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0