| | 139 | |
| | 140 | == Keeping files in sync == |
| | 141 | |
| | 142 | If you are working on a database driven project (like Drupal) it can be difficult to keep your database and (in the case of Drupal) your files directory in sync. |
| | 143 | |
| | 144 | A bash script like the following one can help - by providing an easy way to synchronize your development platform with the live site: |
| | 145 | |
| | 146 | {{{ |
| | 147 | #!/bin/bash |
| | 148 | echo "Synchronizing database." |
| | 149 | ssh <user>@<server> "mysqldump -u <remote-db-user> -p<remote-db-pass> <remote-db-name>" | mysql -u <local-db-user> -p<local-db-pass> <local-db-name> |
| | 150 | |
| | 151 | echo "Synchronizing files." |
| | 152 | rsync -av <user>@<server>:<remote-path-to-files-directory> <local-path-to-files-director> |
| | 153 | }}} |