?
Solved

Copy via ssh

Posted on 2010-08-15
9
Medium Priority
?
473 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
 

Expert Comment

by:brave2120
ID: 33443655
Use SCP command
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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
 

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 1000 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 1000 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

WordPress Tutorial 4: Recommended Plugins

Now that you have WordPress installed, understand the interface, and know how to install new parts, let’s take a look at our recommended plugins.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you receive another warning that your shared drive is almost full and you have asked your users to clean out old files again and again, here is a single command that may help. This command will place all the files that have not been used rec…
If you use Debian 6 Squeeze and you are tired of looking at the childish graphical GDM login screen that is used by default, here's an easy way to change it. If you've already tried to change it you've probably discovered that none of the old met…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

771 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