Created
August 14, 2011 14:55
-
-
Save kopiro/1144950 to your computer and use it in GitHub Desktop.
AutoSync Directory with SSH Server
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Sync directory between client and SSH server | |
usr='VOSTRO_UTENTE_SUL_SERVER_SHH' | |
srv='SSH_SERVER' | |
rdir='~/remote/directory/to/sync' | |
ldir='~/local/directory/to/sync/' #use the / at the end to do not sync the same folder, but only files in the directory | |
slp='30' # timeout between each request, in seconds | |
while (true) do | |
rsync -av $ldir $usr@$srv:$rdir | |
sleep $slp | |
done | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment