The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
Google UNIX.COM



Thread: list of files
View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #4 (permalink)  
Old 08-13-2007
bkan77 bkan77 is offline
Registered User
 

Join Date: Jul 2007
Posts: 53
list of files

Quote:
Originally Posted by blowtorch View Post
You can use rsync for this. Rsync works over ssh as well. If you have to write your own script, you can do something like this:

1. ssh to remote and get list of files (use ssh and ls on remote path)
2. compare remote list with local list and create list of files to remove (files that are not present locally) (use comm command)
3. ssh to remote and remove files that are in the list (use ssh and rm on remote path)
4. scp files from local to remote (scp as in current script)
thnks for the reply
but what i wanted was ,that i dont watn to login onto the remote server manually,i want my script to do that and it must automatically detect find out the list of files and delete the old one's on the remote server to make the list look identical on both the source and the target

thnk you,its urgent so pls any kind of idea is appreciated
Reply With Quote