![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Unable to scp/sftp between two servers | DeCoTwc | UNIX for Dummies Questions & Answers | 1 | 09-12-2008 03:11 PM |
| unable to schedule events through cron | rakshit | HP-UX | 7 | 01-31-2008 04:57 AM |
| SFTP not exiting when run from cron | msabhilash | SUN Solaris | 2 | 12-02-2007 07:48 PM |
| SFTP not working in cron | ewilson0265 | Shell Programming and Scripting | 4 | 12-02-2007 11:29 AM |
| SFTP errorcode 1 when run on cron but runs manually | Heidi.Ebbs | SUN Solaris | 2 | 08-08-2007 12:16 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Unable to sftp with cron (once more time...)
Hi,
I have been searching for older posts and I've found many entries with identical problems, but I was not able to find the solution (or when I thought I found it, my trial didn't worked ). Anyway, here is my question. I wrote a sftp.sh file that runs perfect from command line. It uses scp for getting a file from a remote server. I use a key pair for the authentification, passphrase and ssh-agent included, as I learnt from the forum. Then I added a task in the user crontab. The crontab works fine, as I added a trivial line in the sftp.sh script and it is executed as expected. But the scp line does not work. The sftp.sh script scheme is: #!/usr/bin/ksh /usr/bin/scp root@remote.server:/path/file1 file2 exit 0 In case I use sftp instead of scp: #!/usr/bin/ksh sftp -b /dev/stdin root@remote.server <<EOF get file quit EOF exit 0 I found some comments on the environment of cron, but I was not able to solve the problem with those references... I run it on Red Hat Enterprise 5. If I find any solution I'll post it, but I'm completely run out of ideas (only few weeks linux user, so I don't have many of them, in any case!) Any help???? Thanks!!! |
| Bookmarks |
| Tags |
| cron, scp, script, sftp, shell script, shell scripting, unix scripting, unix scripting basics |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|