FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 03-13-2012, 07:29 AM
Bilal mk
 
Default Expect script does not work on crontab

Hello,

The following script is working fine executing from shell. But does not work running on crontab.

How to fix this crontab issue?


################################################## ##########

#!/usr/bin/expect
spawn /usr/bin/rsync -avz --delete /var/app/ user@somedomain:/var/app/
expect "Password:"
send "somepassword
"
interact
################################################## ###########



Thanks
 
Old 03-13-2012, 10:25 AM
Claudius Hubig
 
Default Expect script does not work on crontab

Hello Bilal,

Bilal mk <bilalhifx@gmail.com> wrote:
> The following script is working fine executing from shell. But does not
> work running on crontab.
>
> How to fix this crontab issue?

Check the output of

$ env

when run in the crontab and in the shell.

Best regards,

Claudius
--
BOFH excuse #353:

Second-system effect.
Please use GPG: ECB0C2C7 4A4C4046 446ADF86 C08112E5 D72CDBA4
http://chubig.net/ http://nightfall.org
 
Old 03-13-2012, 05:47 PM
 
Default Expect script does not work on crontab

>> On Tue, 13 Mar 2012 13:59:35 +0530,
>> Bilal mk <bilalhifx@gmail.com> said:

B> The following script is working fine executing from shell. But does not
B> work running on crontab. How to fix this crontab issue?
B> #!/usr/bin/expect
B> spawn /usr/bin/rsync -avz --delete /var/app/ user@somedomain:/var/app/
B> expect "Password:"
B> send "somepassword
"
B> interact

I believe the "interact" line is messing you up; when "expect" sees that,
it wants a terminal or PTY to play with, and cron doesn't give it one.

--
Karl Vogel I don't speak for the USAF or my company

I smile because I don't know what's going on. --bumper sticker


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20120313184717.E6D36BFE8@kev.msw.wpafb.af.mil">htt p://lists.debian.org/20120313184717.E6D36BFE8@kev.msw.wpafb.af.mil
 

Thread Tools




All times are GMT. The time now is 04:14 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org