, Change the group permissions on the production folder: , sudo chmod -R 774 /var/www/html/mpg , , rsync development server to production server: , rsync -avz /var/www/html/mpg pete@peteolson.me:/var/www/html , ,
, added user to www-data group , using ssh key pair for authentication (rsync by default uses ssh as transport) , using the --delete option to remove any files / folders on destination that have been deleted on source , using the -a archive flag: copy files recursively and preserve group and user ownership , using the -z compression flag: uses more cpu but increases network through-put , The verbose option (v) , The human-readable option (h) , remote shell use SSH (e) , –progress , , rsync -az --delete pete@peteolson.me:/var/www/html /mnt/2tb/backup/digital-ocean/ , ,
, When specifying the directories, be clear on whether you include the trailing slash. , In the above example, /home/user/directory would not be the same as /home/user/directory/. , The additional slash tells rsync to copy the contents but not the directory itself. , Without it, rsync will also create the directory. ,