scp in bash script only getting to 11%
Hello,
I have a very simple bash script (bottom of post), which creates a database dump, and sends it using scp to a separate host. It creates the dump successfully, but the scp only ever gets to 11%. (output bellow). Quote:
File size of the dump is about 1.5GB. There is nothing in any logs which seems related. Can any one suggest what i might be doing wrong? (im fairly new to writing bash scripts!). Many Thanks! SCRIPT: Quote:
|
Why not use SSH Certification for this.
My earlier working setup goes as below: Code:
1. The basis of using ssh without typing your password is public key based authentication. You need to generate a pair of public/private keys for this. We shall stick to version 2 of ssh. Thanks goes to author from where I took the above tutorial and all who suggested me to use SSH instead of expect in this forum. |
Thanks. Ill give that a go. Not sure it will solve the problem though, and the expect is working at the moment?
Thanks! |
Can you scp the backup file, from CLI? You can use the -v option to make scp more verbose.
Regards |
I second the use of public key authentication. Using expect to "type in" passwords for you is useful in some cases (e.g. test automation) but shouldn't be used for day-to-day authentication if it can be avoided.
With regards to the scp command not working... try to reduce the complexity. Does it work if you do it maunally - starting the scp command from an interactive shell and typing in the password yourself? Assuming it still fails from an interactive shell, the first thing which springs to mind is that the destination filesystem does not have enough space. Did you check that? |
PHP Code:
|
All times are GMT -5. The time now is 08:28 PM. |