SSH transfer script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting SSH transfer script
# 1  
Old 01-21-2012
SSH transfer script

Hello,

I have a set of documents in a folder in my laptop (project files, codes etc) . I have the same material on a remote host over an SSH connection, and most of the time I end up editing one version, and sometimes the two versions go out of sync.

I have tried to use Gftp for transferring files, but found it messy, I would like to develop a script such that it downloads the file listing on the remote directory (recursively) and compares it with the local directory recursively, and ensures that the latest version is there in both places.

Is it possible to use sftp in any way ?
# 2  
Old 01-21-2012
Have you already considered rsync?
Code:
man rsync

# 3  
Old 01-21-2012
Fully agree , rsync (maybe over ssh) is the solution.
This User Gave Thanks to r0bby For This Post:
# 4  
Old 01-21-2012
CVS

Perhaps it would be worth starting an account with bitbucket.org so you have a single copy of the code, available anywhere.

Of course rsync would work ok, but if you are learning to become a Linux professional you are going to end up using a version control system anyway.

Bitbucket is free and then someone else is responsible for keeping your code safe, and they are pretty likely to have more robust computers at their disposal than you do anyhow. Smilie
# 5  
Old 01-21-2012
Rsync did the trick

Hello,

Rsync s working quite well for me.. I will mark this thread as solved....!
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Ssh script to validate ssh connection to multiple serves with status

Hi, I want to validate ssh connection one after one for multiple servers..... password less keys already setup but now i want to validate if ssh is working fine or not... I have .sh script like below and i have servers.txt contains all the list of servers #/bin/bash for host in $(cat... (3 Replies)
Discussion started by: sreeram4
3 Replies

2. UNIX for Dummies Questions & Answers

SSH SSH encountered 1 errors during the transfer

This issue was resolved due to using the correct user transferring the file over to the desktop. (1 Reply)
Discussion started by: Computergal2104
1 Replies

3. Shell Programming and Scripting

A Script On Transfer Time

I wanna make a shell script that calculates the total time spent on copying a file. Script will simply copy a file using cp command or maybe wget.. Which commands i can use to get the time details of a file? thanks, (3 Replies)
Discussion started by: Mhnds
3 Replies

4. Shell Programming and Scripting

Script to transfer files

Hi, I am new to scripting, I need to write a script to transfer .TXT files from Server A (ftp) to Server B. Once the files in server B i need to transfer it to server C (sftp). (not transfer of files directly from server A to Server C ) Thanks! Regards Sendhil ---------- Post updated at... (3 Replies)
Discussion started by: Sendhil.Kumaran
3 Replies

5. Shell Programming and Scripting

Automating file transfer between two SSH enabled server.

Hi Experts, Few more words to the title, both the servers are ssh enabled but I have read only access to the second server, so I cannot automate SFTP process using RSA/DSA keys. I am using Control M to trigger the script and do not want any manual intervention to enter the password to complete... (4 Replies)
Discussion started by: nchourasiya
4 Replies

6. Shell Programming and Scripting

Using ssh to transfer file not working inside if-condition

Hi all, ssh uname@remote_server 'cat /tmp/remote_file_name > home_dir/a512386/new/local_file_name' The above given command is working fine. but if i try to move the file only if exists in the remote server i.e) giving the same within if condition it executes but the file is not stored in my... (1 Reply)
Discussion started by: Shri123
1 Replies

7. UNIX and Linux Applications

Central Location for all ssh Keys and Settings Unattended Secure File Transfer

I am developing an application that submits command line file transfers using ssh (Sun to Sun) and Tectia ssh (Sun to Windows Server) embedded in the code. Potentially many different trusted people will start the programs. Is there a way to have all the settings and keys localized so that there is... (0 Replies)
Discussion started by: PowersThatB
0 Replies

8. UNIX for Advanced & Expert Users

SSH : File transfer

We have tow servers.One Linux server (A) and one unix server (B). How can i set up so that files can be sftped from A to B. Please let me know the steps (4 Replies)
Discussion started by: dr46014
4 Replies

9. AIX

How to use SSH Secure File Transfer tool from windows to AIX without password?

If I use SSh Secure File Transfer tool on Windows, I want to transfer file from windows to AIX without password, how to do it? (6 Replies)
Discussion started by: rainbow_bean
6 Replies

10. Shell Programming and Scripting

Transfer script.

Hi folks, I have written down transfer script , which actually reads the file name from input and FTP the file to other server . there are following things I am looking for - our files name are with sequential number like in our server file is placed with combination filename+data+seq... (1 Reply)
Discussion started by: khan1978
1 Replies
Login or Register to Ask a Question