The UNIX and Linux Forums  


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
Calling expect scripts from other expect scripts seva Shell Programming and Scripting 0 04-03-2008 02:45 PM
cronjob wiz83 UNIX for Dummies Questions & Answers 1 01-25-2008 02:47 AM
sftp not working as cronjob tungaw2004 UNIX for Dummies Questions & Answers 3 01-10-2008 08:27 PM
Expect and auto expect command arun_v Shell Programming and Scripting 0 03-29-2006 08:31 AM
Automating SFTP with Expect sysera Shell Programming and Scripting 2 09-16-2005 07:05 AM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 06-18-2008
digitac digitac is offline
Registered User
  
 

Join Date: Jun 2008
Posts: 2
expect + cronjob + SFTP

Hi all, i got a really strange problem

i wrote a script, when i run this script manually everything works fine
but when i make a cronjob for it, with the same user, the EXPECT script will not work.
Only the first line will be executed

this is the SHell bash script

Code:
#!/bin/sh;
php -q /home/tsjingcom/HTML/consumentbeheer/files_cassis/scripts/export.php > /home/tsjingcom/HTML/consumentbeheer/files_cassis/scripts/export_php.log;
sleep 5
/usr/bin/expect /home/tsjingcom/HTML/consumentbeheer/files_cassis/scripts/export.exp > /home/tsjingcom/HTML/consumentbeheer/files_cassis/scripts/export_transfer.log;

this is the EXPECT script

Code:
#!/usr/bin/expect

spawn sftp -o port=10022 -b /home/tsjingcom/HTML/consumentbeheer/files_cassis/scripts/batchfiles/export.batch user@host:incoming

expect "user@'s password:" 

send "\r"

interact

i really hope someone can give me a sollution, i am trying for 2 months to fix this
 

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:52 AM.


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