I have the following code. How can I redirect the output of the expect to a log file to see if the scp has copied everything successfully. This piece of my code runs in background.
export L_SRC_SID L_SID MOUNT_POINT SERVICE_PASS APP_SERVER_1 SRC_MOUNT_POINT
#And now transfer the file over
/usr/bin/expect -c '
set timeout -1
cd /$env(MOUNT_POINT)/$env(L_SID)/apps
spawn scp -pr apps$env(L_SRC_SID)@$env(APP_SERVER_1):/$env(SRC_MOUNT_POINT)/$env(L_SRC_SID)/apps/* .
expect {
yes/no { send yes\r ; exp_continue }
password: { send $env(SERVICE_PASS)\r }
}
expect eof
'