| | |
Running Automatic SFTP From Windows to Linux
![]() |
•
•
Join Date: Jun 2005
Posts: 2
Reputation:
Solved Threads: 0
I want to run a batch file which can connect automatically to SFTP Server running on Linux and can download files from Linux remote side to my local side. Besides that, this file will be scheduled to run automatically on every month. But, I'm facing a problem to connect it automatically? Below is one of my example of testing it:
set username=micro
set password=test
set r_dir=/home/micro/output
set l_dir=c:/temp
set filename=CDR-2005-05.csv
set tempSftpScript=script.batch
echo user %username%_%password%>>%tempSftpScript%
echo cd %r_dir%>>%tempSftpScript%
echo lcd %l_dir%>>%tempSftpScript%
echo get %filename%>>%tempSftpScript%
rem echo bye>>%tempSftpScript%
CALL c:\cygwin\bin\sftp.exe -b:%tempSftpScript% micro@url.com
if I just run the following code:
CALL c:\cygwin\bin\sftp.exe macrolynx@url.com
Then, it can connect automatically but also need to enter password manually.
Is there any way to connect to SFTP and download file automatically from Linux?
Your reply will be appreciated.
Thank You in advance,
Teing
set username=micro
set password=test
set r_dir=/home/micro/output
set l_dir=c:/temp
set filename=CDR-2005-05.csv
set tempSftpScript=script.batch
echo user %username%_%password%>>%tempSftpScript%
echo cd %r_dir%>>%tempSftpScript%
echo lcd %l_dir%>>%tempSftpScript%
echo get %filename%>>%tempSftpScript%
rem echo bye>>%tempSftpScript%
CALL c:\cygwin\bin\sftp.exe -b:%tempSftpScript% micro@url.com
if I just run the following code:
CALL c:\cygwin\bin\sftp.exe macrolynx@url.com
Then, it can connect automatically but also need to enter password manually.
Is there any way to connect to SFTP and download file automatically from Linux?
Your reply will be appreciated.
Thank You in advance,
Teing
You could write a shell script and have it run via the cron
Firefox: no, its not the end all solution, it has its own issues and in time it will be just as insecure as IE, when its hit Firefox 6, if it makes it that far. Oh, and AOL pays for it, incase you didn't know.
Microsoft & Windows: If you hate it so much, move to linux, or bsd, or anything else, stop complaning and move on.
Good starting places: Gentoo Novell SUSE Fedora Core Apple
Microsoft & Windows: If you hate it so much, move to linux, or bsd, or anything else, stop complaning and move on.
Good starting places: Gentoo Novell SUSE Fedora Core Apple
•
•
Join Date: Jun 2005
Posts: 2
Reputation:
Solved Threads: 0
To: Zachery
Thank you for your reply and suggestion. You suggested to write shell scripts & run it via the cron job.
For your information, I have no access permission to the remote server Linux to create cron job due to the server is from the other party. But my task is just want to access to the server and download an csv file to my local side.
I am using windows platform, can i do all this task and run it by shell script?
I'm not very good at Linux, or is it possible to run by batch files?
And, Because of the schedule task is same as cron job, I just think to run the schedule task which will run the shell script/batch file.
Pls: is it possible to give me sample of program which can perform this tasks?
Thanks very much & Apologize for all the disturb & mistake that I have done.
Teing
Thank you for your reply and suggestion. You suggested to write shell scripts & run it via the cron job.
For your information, I have no access permission to the remote server Linux to create cron job due to the server is from the other party. But my task is just want to access to the server and download an csv file to my local side.
I am using windows platform, can i do all this task and run it by shell script?
I'm not very good at Linux, or is it possible to run by batch files?
And, Because of the schedule task is same as cron job, I just think to run the schedule task which will run the shell script/batch file.
Pls: is it possible to give me sample of program which can perform this tasks?
Thanks very much & Apologize for all the disturb & mistake that I have done.
Teing
![]() |
Similar Threads
- Windows vs Linux (IT Professionals' Lounge)
Other Threads in the Windows NT / 2000 / XP Forum
- Previous Thread: logon
- Next Thread: I neeed help please ....
| Thread Tools | Search this Thread |
.net 2007 2010 a.exe address alaris apache appstore arm auto automatically black blue book bulletin cellphones chkdsk collaboration computer computerfreezes crash cursor deployment desktop desktops dns dotnetnuke drive eartlink error errors explorer features folder fontmanagers format framework gadgets intel internet interoperability killprocess laptop linux load login mac memory microsoft mobile monitor motionle1600 netbooks novell nvidia open operatingsystems osx palm partition patch port printer product proxy remotedesktop remotedesktopconnection repair replacingraiddrive retrieve screen sharepoint simplifiedchinese sitetositevpn sp1 technology unreadable update usb verizon videodrivers videogames virtual virus vista visual vulnerability wab webos weecam win win32/heur window windows windows7 windowsxp windowsxpnotstartingup. worm xp xpde





