fuzzylizard Posted January 21, 2003 Report Share Posted January 21, 2003 I am not sure if this is suppose to go here, but I am looking for a way to sync directories over ssh. I have my home directory at school and a similiar directory at home. I would like to be able to sync these two directories so that they are the same. However, I can only access my school directory from home using ssh or sftp. Is there a sync command built into ssh somewhere that will accomplish what I want? Thanks. Quote Link to comment Share on other sites More sharing options...
aru Posted January 21, 2003 Report Share Posted January 21, 2003 rsync is what you want, it can work through ssh if this enviroment variable is set: export RSYNC_RSH="ssh" For example: #!/bin/bash sincronizar () { usage="Usage: sincronizar "local directory" "remote directory"" local="${1?$usage}" remote="${2?usage}" command="rsync -avuzb --exclude '*~'" $command $remote $local $command $local $remote } sincronizar "${HOME}/bin" "arusabal@slack_machine:/binaries" I use cron with something similar to the above code to syncronize directories between my two machines Quote Link to comment Share on other sites More sharing options...
fuzzylizard Posted January 22, 2003 Author Report Share Posted January 22, 2003 Thanks, I will give that a try. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.