SCP SSH automatic file transfer
Hello all,
I wrote this script in attempt to set-up automatic file fetch from the server using SSH; I want to collect *.pdf files and would like this to happened automatically. However, when I run below script I keep getting prompted for a password, my questions are: 1.can someone advice how to include password in the script and 2.how to export list of transferred files into the log file in txt format scp root@192.168.1.1:/var/www/html/Apps/*.pdf /media/DataBackup/Linux/imported/ &>/home/denis/Logs/remotefilefetch.sh.out This script works to a point, however I am prompted for a password and log file is created but remains empty. Thank you in advance Denis |
Quote:
Quote:
Code:
script -c "scp command here" file.log |
Hi,
Thanks for your help, I have now configured ssh and private/public key and everything is working as I wanted including log output. #script -c "scp root@192.168.1.1:/var/www/html/Apps/*.pdf /media/DataBackup/Linux/imported/" /home/denis/Logs/remotefilefetch.log Best wishes Denis |
You're welcome! I'm glad to know it works! :)
|
All times are GMT -5. The time now is 03:04 AM. |