|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
running a script in crontab
I need help. I'm trying to run a script to go out and get a file using ftp from to machines on my network daily. The script works fine when executed from the command line. However, I put it into the "crontab -e" (with the full path), I get and error of "unknown local host" .
Can anyone help me with this. thanx ![]() |
|
#2
|
|||
|
|||
|
Probably trying to mail error or output to you but either mail
is not set up on this system or it is encountering an error. |
|
#3
|
|||
|
|||
|
Quote:
You have to ensure that the cron job is running in the same environment that your command line script has. Check the output of the env command both in the cron job and from the command line. Regards ![]() |
|
#4
|
|||
|
|||
|
Quote:
If the env is different, how do i make the changes |
|
#5
|
|||
|
|||
|
FWIW...
crontab -l (to see if a crontab exists in the same shell as the user) to remove the current crontab : crontab -r to create a new crontab type: crontab /path/to/crontab.txt one problem with using a Windows system to compose scripts and crontabs is hidden characters that will prevent cron from executing a script...even though the script will run from bash... |
|
#6
|
|||
|
|||
|
type "echo $shell" to find what shell your running from prompt and force that shell in the first line of your script. Like !#/bin/sh.
cron runs in s stark environment so you need to set your envirmonment variables and/or use full paths. |
![]() |
| Viewing: Dev Shed Forums > Operating Systems > UNIX Help > running a script in crontab |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|