The Poor Man's Cloud
Imagine, you have a working directory under "/home/you/img/new" on your local computer. That's where you keep images and where you put new ones after you have finished them. Every day or every few hours you upload your finished work to /var/www/img/my_images on your web server. You also want to have the rest of the /var/www/img directory, where other users upload their images mirrored locally so you need to update your $HOME/img dir too. You want to keep file permissions as they are and only send or recieve those files that have actually changed:
sync directory "/var/www/img/new" on remote server with local directory ./img/new :
rsync -vza img/new/ user@example.com:/var/www/img/new
sync ./img on your local machine with /var/www/img/cal on the server:
rsync -vza user@example.com:/var/www/img/ img
you might want to run this manually, or let a cron job do it:
crontab -e5 30 * * * rsync -vza /home/you/img/new/ \
user@example.com:/var/www/img/new > /dev/null \
&& rsync -vza user@example.com:/var/www/img/ /home/you/img > /dev/null