script to sftp file to remote server
Hi All,
I am looking to setup a script on my Redhat distro that will transfer a file to a remote server via sftp. I have already added a private key from the remote server to my box using ssh-add and I have tested the connection without having to enter a password. This is how I would like to do it; 1. take a file from a directory /home/user/latest_file (the file name is always changing i.e file_120306) 2. mv the newly transfered file to a archive dir /home/user/archive 3. include this into my crontab for checking 4 times a day. Anyone who can help me with this, it would be greatly appreciated. Cheers !! |
Here are the scripts I use for that job. I don't know if they work with Open-SSH but they do work with SSH.com's SSH. First, putting files onto another server:
Code:
#!/bin/sh Code:
#!/bin/sh |
This is great !! Thanks .. I will try this ASAP
|
Updated to OpenSSH
I've updated the SFTPget/put scripts so that they work with OpenSSH as well as SSH.com SSH. You can get them here: http://homepages.shu.ac.uk/~cmsps/freeScripts
|
Home page moved
I have had to move my home page so the link in the previous post is outdated. Also, the the three scripts have been rolled into one.
You can get the SFTP script from: http://www.apxd65.dsl.pipex.com/freeScripts/#SFTP |
nice looking script cmsps.
|
Agreed, very nice script. Thank you cmsps.
|
All times are GMT -5. The time now is 10:03 PM. |