Blame
|
1 | # Sync content onto server |
||||||
| 2 | ||||||||
| 3 | We usually use ssh and `rsync`. |
|||||||
|
4 | |||||||
| 5 | ```bash |
|||||||
|
6 | # Our most advanced rsync incantation |
||||||
|
7 | rsync -avur --chown=docker:docker /path/to_local_location/ user@remote.adress.org:/path/to_remote_location/ |
||||||
| 8 | ``` |
|||||||
| 9 | ||||||||
| 10 | :::warning |
|||||||
| 11 | ## Mind the Trailing Slash (/) in rsync Paths |
|||||||
| 12 | ||||||||
| 13 | When using rsync, the presence or absence of a trailing slash (/) on the source path changes how files are copied: |
|||||||
| 14 | ||||||||
| 15 | ||||||||
| 16 | - ✅ With a trailing slash (/path/to/local_dir/): |
|||||||
| 17 | ||||||||
| 18 | → rsync copies the contents of the directory into the destination. |
|||||||
| 19 | ||||||||
| 20 | (This is what you usually want.) |
|||||||
| 21 | ||||||||
| 22 | - ⚠️ Without a trailing slash (/path/to/local_dir): |
|||||||
| 23 | ||||||||
| 24 | → rsync copies the entire folder itself (as a subdirectory) into the destination. |
|||||||
| 25 | ||||||||
| 26 | (This can accidentally create an extra nested folder.) |
|||||||
| 27 | ::: |
|||||||