fuzzylizard Posted January 21, 2003 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. Link to comment Share on other sites More sharing options...
aru Posted January 21, 2003 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 Link to comment Share on other sites More sharing options...
fuzzylizard Posted January 22, 2003 Author Share Posted January 22, 2003 Thanks, I will give that a try. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now