Solved

Copy via ssh

Posted on 2010-08-15
9
461 Views
Last Modified: 2013-12-06
Hi experts,

I want to copy some files from Windows to Linux(RHEL 5).
How can I do that with ssh command?
And when I copy, filename of each file will be added the date today.
Ex:
Windows        Linux(RHEL 5)
costumer  --> costumer-20100831

Please tell me the code to do that? Also the app to recognize ssh command in Windows?

Thank you very much folks.
0
Comment
Question by:softbless
9 Comments
 
LVL 5

Expert Comment

by:eNarc
ID: 33443593
there are many apps that use ssh, as it doesn't matter what platform your transfering to ssh is standard.

http://smartftp.com/
http://winscp.net/
http://putty.org/
http://sshexplorer.com/
http://openssh.org/

mac:
http://cyberduck.ch/
0
 
LVL 5

Expert Comment

by:eNarc
ID: 33443642
0
 

Expert Comment

by:brave2120
ID: 33443655
Use SCP command
0
 

Author Comment

by:softbless
ID: 33443657
Hi eNarc,

First I say sorry. Actually I want a batch file on Windows.
So I can execute that batch file.

Thank you very much eNarc.
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
LVL 10

Expert Comment

by:nabeelmoidu
ID: 33443813
0
 
LVL 5

Expert Comment

by:eNarc
ID: 33444063
0
 

Author Comment

by:softbless
ID: 33444194
Sorry I reply my question,

I want to copy some files from Windows to Linux(RHEL 5) by execute a batch file.
How can I do that with ssh command in batch file?
And when I copy, filename of each file will be added the date today.
Ex:
Windows        Linux(RHEL 5)
costumer.txt  --> costumer-20100831.txt

Please tell me the code to do that? Also the app to recognize ssh command in Windows?

Thank you very much.
0
 
LVL 3

Accepted Solution

by:
kiitii earned 250 total points
ID: 33444354
I would suggest you try out putty-installer.exe
There is a command line program called "pscp.exe"
Copy this file into C:\Windows\System32, so that you can run this command from anywhere.


Then you will need to setup your putty key, for keyless access to linux box.
c:\> pscp  customer.txt   root@linux-box-ip:/folder/  

Then create a script in linux to rename the new files into your desire filename. Schedule the script to run after "pscp" command.

===Auto rename script.sh===
#!/bin/sh
mv   customer.txt   customer-$(date +%F).txt
========================
0
 
LVL 3

Assisted Solution

by:berniep
berniep earned 250 total points
ID: 33450506
in addition to using putty's pscp as mentioned above, add the following to your windows batch script to copy the file with your date tag:

for /f "Tokens=2-4 Delims=/ " %%i in ('date /t') do  set datetag=%%k%%j%%i
pscp file user@host:/path/file-%datetag%

if you want to inclue the time:
for /f "Tokens=1-2 Delims=: " %%i in ('time /t') do set timetag=%%i%%j
pscp file user@host:/path/file-%datetag%-%timetag%
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

This article was inspired by a question here at Experts Exchange (http://www.experts-exchange.com/Software/Photos_Graphics/Images_and_Photos/Q_28629170.html). The requirements stated in that question are (1) reduce the file size of a large number of…
The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now