indigo-magician

How To Use Rsync With A Raspberry Pi Web Server

I spent the better part of an evening figuring out how to make this work and thought I would share a video I created detailing how you can use rsync with your Raspberry Pi.

I am using rsync to move files from my laptop to my Raspberry Pi web server.

I had to string together 3 tutorials and will detail all my steps in this video below.

Here is the quick version

You will need to change the Raspberry Pi web server’s folder permissions to belong to the user who is rysncing the files.

You can change those permissions by issuing the following command

sudo chown -R youruser:www-data /var/www

You must do this if you are running Raspbian (Jessie) because Pi, the default user, is locked down from SSH which is what rsync uses. It is advisable to great a NEW user and not use Pi when doing SSH commands. If you need help creating a new user check out the video above.

Once the file permissions are changed you can rsync from your local setup to your Raspberry Pi web server with this command.

rsync -a ~/Projects/ExampleSite raspibakery@192.180.90.3:/var/www/html

I ran into issues with trailing slashes so leave them off.

You will be prompted for your new user’s password and if everything works you can now check http://localhost and see your changes.