Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Debian User (http://www.linux-archive.org/debian-user/)
-   -   Expect script does not work on crontab (http://www.linux-archive.org/debian-user/643980-expect-script-does-not-work-crontab.html)

Bilal mk 03-13-2012 07:29 AM

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

Claudius Hubig 03-13-2012 10:25 AM

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

03-13-2012 05:47 PM

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


All times are GMT. The time now is 08:23 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.