- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Help with expect scsript, running as a cronjob
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2006 04:36 PM
10-26-2006 04:36 PM
Help with expect scsript, running as a cronjob
Following is the expect script that i have kept in crontab file:
===========================
#!/usr/local/bin/expect
spawn sftp -b /home1/purifyte/gangadhar/new/cmd ganga_k@172.16.2.25
expect "password:"
send "pass123\n";
interact
and the "cmd" file content is as follows:
=========================================
lcd /home1/purifyte/gangadhar/new/
put testfile /users/spv/gangadhar/testfile
bye
The thing is, if i run the expect script from command prompt, its running nicely, and i am getting the file in dest machine.
But when i keep it in crontab file, the file is not at all getting transferred.
Please help me ASAP. Its urgent.
Thanks in advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2006 06:13 PM
10-26-2006 06:13 PM
Re: Help with expect scsript, running as a cronjob
regards,
ivan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2006 06:49 PM
10-26-2006 06:49 PM
Re: Help with expect scsript, running as a cronjob
#!/usr/local/bin/expect
spawn /usr/bin/sftp -b /home1/purifyte/gangadhar/new/cmd ganga_k@172.16.2.25
expect "Password:"
send "pass123\r"
Remove that "interact" because you don't want to run it interactively.
Yang
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2006 07:06 PM
10-26-2006 07:06 PM
Re: Help with expect scsript, running as a cronjob
Thanks for your reply but i have given full path only.
@Yang Qin
Thanks for your reply but that "interact" doesn't mean that its taking the inputs interactively.
It'll come out without taking the password if we don't give the "interact" in expect script.
Any other solutions plz.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2006 10:29 PM
10-26-2006 10:29 PM
Re: Help with expect scsript, running as a cronjob
Yang
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2006 11:32 PM
10-26-2006 11:32 PM
Re: Help with expect scsript, running as a cronjob
/home1/purifyte/gangadhar/new/
/home1/purifyte/gangadhar/new/cmd
/home1/purifyte/gangadhar/new/testfile
Is the user you cron'd the job under the same as the one you manually ran the script under? If not, ensure that he/she has +rx for the dir and +r for the files. Make sure the user appears in /var/adm/cron/cron.allow.
Also make sure $SHLIB_PATH and other environmental variables are set correctly in non-interactive mode. This can be accomplished through a wrapper script.
If you are still stuck, please post your revised scripts (using absolute paths).
PCS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2006 03:54 AM
10-27-2006 03:54 AM
Re: Help with expect scsript, running as a cronjob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-29-2006 04:12 PM
10-29-2006 04:12 PM
Re: Help with expect scsript, running as a cronjob
i tried running it in background, by putting '&' at the end of the script. Now i got to know that it can't run in the background.
As per my knowledge, any process which needs interactive input, can't run in background. In this case, ultimately it needs input from standard input, we are givin it by using "expect script". So it can't run in the background.
Plz let me know if i am wrong somewhere, or in case of better answers.
Regards,
Gangadhar