Link to home
Start Free TrialLog in
Avatar of sachinkapila
sachinkapila

asked on

File Move using FTP or sFTP

I want to write a script to move (Not Copy)files from a server to local machine. I can either use FTP or SFTP. Any idea how to do this I don't see any move command I cannot do a copy and delete I have that limitation.
Avatar of Arjun1
Arjun1

Hello,

Have you  tried PUT (mput) and GET(mget) command ?
ASKER CERTIFIED SOLUTION
Avatar of yuzh
yuzh

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
If you go to command line you can type a command similiar to this in or you can write a batch with this already in it (and schedule time for it runs, if that is what you want):

ftp -i -s:filename hostname

replace filename with a text file with FTP commands in it, these commands will automatically run once the connection is made. The -i will suppress and prompts and the hostname should be replace with the destination server name. To get more info you can go to command line and type:

ftp ? ?

Hope this helps
warming, FTP use plain text passord, a sniffer can capture your password !
For sachinkapila:

Please modify the script:

From:

# transfer file from remote server
ssh me@remoteserver "(cd /source-dir ; tar cvf - filename)" | tar xvf -

To:

ssh me@remoteserver "(cd /source-dir ; tar cf - filename)" | tar xvf -

It will work better, less screen message!

Cheers!

how's it going?
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is to:

Be PAQ'd/Points No Refunded

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Paul
EE Cleanup Volunteer
I believe that I have given the completed answer for the question.
Points to yuzh.

Yensidmod
EE Moderator