Open main menu

OpenVZ Virtuozzo Containers Wiki β

Changes

Physical to container

424 bytes added, 15:32, 25 June 2012
rsync: include -H and -X to preserve hard links and extended attrs. Use --one-file-system option to simplify exclude list and improve rsync security.
=== rsync ===
rsync example (run from On the new HN)create a file <code>/tmp/exclude.txt</code> with: rsync -avz --numeric-ids --exclude=<pre>/tmp/boot/lib/dev --exclude=modules/proc --exclude=etc/tmp -e ssh root@a.b.c.d:blkid/ etc/vzmtab/privateetc/123lvm</pre>
'''Advantageand run <b>rsync</b> as follows:''' Your <source lang="bash"> rsync -avz -H -X --one-file-system doesn't really go down--numeric-ids --exclude-from=/tmp/exclude.txt -e ssh root@a.b.c.d:/ /vz/private/123/</source>
{{Note|You should add the "<code>-H" </code> option, so hardlinks will be preserved during sync. and also include the <code>-X</code> option to preserve file extended attributes}} If your source system have multiple partitions (for example <code>/var</code> or <code>/home</code>) repeat the command above for each partition in your system; for example:<source lang="bash">rsync -avz -H -X --one-file-system --numeric-ids -[[Special:Contributions/194.95.66.21|194e ssh root@a.95b.66c.21]] 12d:05, 8 September 2011 (UTC)}}/var/ /vz/private/123/var/</source>
'''Advantage:''' Your system doesn't really go down.
19
edits