![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| sar logs in /var/adm/sa | RobSand | SUN Solaris | 1 | 10-03-2007 04:58 AM |
| logs | lordmod | UNIX for Advanced & Expert Users | 1 | 02-13-2007 06:41 PM |
| Logs | charbel | Shell Programming and Scripting | 5 | 05-04-2006 08:59 AM |
| rcp logs | ilkergu | HP-UX | 0 | 08-08-2005 04:51 AM |
| logs | cubicle^dweller | UNIX for Dummies Questions & Answers | 6 | 10-29-2002 07:42 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
to write the logs of scp
Hi Unix gurus,
I created this script to automate the copying of files daily from one server to another using the scp command. --> #!/bin/ksh KEY="$HOME/.ssh/SSHKEY" if [ ! -f $KEY ];then echo "Private key not found at $KEY" >> $LOGFILE echo "* Please create it with \"ssh-keygen -t dsa\" *" >> $LOGFILE exit else echo "Transferring files.." >> $LOGFILE echo "scp -v -i $KEY $FILES $SCP_LOGIN@$SCP_MACHINE:$SCP_PATH" >> $LOGFILE scp -v -i $KEY $FILES $SCP_LOGIN@$SCP_MACHINE:$SCP_PATH >> $LOGFILE echo "Copy files successful.." >> $LOGFILE fi But I have these questions below: 1. Whenever I ran this script, it no longer ask for password but it still prompts the "Are you sure you want to continue connecting (yes/no)?" question: See details below: --> Putting your key on remote server Transferring files.. The authenticity of host '10.68.169.168 (10.68.169.168)' can't be established. RSA key fingerprint is cd:78:a1:fe:2d:8d:aa:0f:32:be:18:5b:74:0e:3a:c1. Are you sure you want to continue connecting (yes/no)? yes Failed to add the host to the list of known hosts (/shared/home/ngtman/.ssh/known_hosts). Can I also automate it in a way that it always answers yes to the above question w/o me typing anymore? 2. How can i display the error messages of the scp in the $LOGFILE for cases that scp was not successful for some files? i.e. there are space issue with the remote server, connection time out, or permission issues. I just want to see in the log what happened to the scp so as it would also be better for the support guys to check as in case anything happens. I tried both redirecting using >> and using the tee command but both not writing to the logfile, only displaying the status in the prompt. Hoping to hear from you guys. Thanks in advance. |
|
|||||
|
gholdbhurg,
The rules say (4) Do not 'bump up' questions if they are not answered promptly. No duplicate or cross-posting and do not report a post or send a private message where your goal is to get an answer more quickly. You have already broken it twice. Once more and you will earn a ban. Please be patient and adhere to the rules. Your other thread - scp automated script |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|