• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 577
  • Last Modified:

Automated file copy from Linux server to Windows box

I have a FC5 Linux machine that runs a shell script daily to pull backup files from a remote Linux web server. This is all the machine does. It is rather old and the file system is starting to randomly crash so the daily transfer fails due to the root volume dropping into read-only protected mode. Since I have to manually move the files periodically to a windows server anyway I need to run a scheduled script on the WIndows machine to pull the files from the web server directly. A cron job on the web server creates the daily backup files and stages them in a directory for transfer. The local Linux box that is failing runs the following shell script that lives in /etc/cron.daily and uses an rsa key for login vaidation, which I don't know much about:

scp -i /home/localuser/my-auth/id_rsa -pr user_id@mydomain_name.org:mylinuxbox/* /staging/data_backup/.
exit
chown root:root /staging/data_backup/*

Can I run Winscp in command line or in some other way to do the same thing to bring the files directly to the Windows box?
0
Nozmoking
Asked:
Nozmoking
  • 2
2 Solutions
 
Heem14Commented:
Yes, but you'll want to get "PSCP" from the putty software:

http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html

the syntax on PSCP is same as SCP

0
 
NozmokingAuthor Commented:
Thanks - since the Linux box uses rsa keys for login credentials on the remote server, can I copy them to the Windows machine and reference the same keys in the script? I haven't dealt with this type of unattended authentication before.

-noz
0
 
omarfaridCommented:
You need to generate the keys on the windows system and copy the  public keys to each machine.

Please see the links below:

http://www.astro.caltech.edu/~mbonati/WIRC/manual/DATARED/setting_up_no-password_ssh.html
http://waelchatila.com/2005/06/06/1118124232757.html
http://www.cvrti.utah.edu/~dustman/no-more-pw-ssh/
0
 
NozmokingAuthor Commented:
Got it - that's what I was looking for.

Thanks very much!
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now