Changeset 215

Show
Ignore:
Timestamp:
01/14/11 21:51:17 (3 years ago)
Author:
depesz
Message:

add documentation about tablespaces in backups

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/omnipitr/doc/omnipitr-backup-master.pod

    r192 r215  
    295295relate to date/time of beginning of backup process. 
    296296 
     297=head2 TABLESPACES 
     298 
     299If I<omnipitr-backup-master> will detect additional tablespaces, they will be 
     300also compressed to generated tarball. 
     301 
     302Since full path to tablespace directory is important, and should be preserved, 
     303and normally tar doesn't let you store files which path starts with "/" (as it 
     304would be dangerous), I<omnipitr-backup-master> uses following approach: 
     305 
     306all tablespaces will be stored in tar, and upon extraction they will be put in 
     307directory "tablespaces", and under it - there will be full path to tablespace 
     308directory. 
     309 
     310For example: 
     311 
     312Assuming PostgreSQL PGDATA is in /var/lib/pgsql/data, and it has 3 extra 
     313tablespaces placed in: 
     314 
     315=over 
     316 
     317=item * /mnt/san/tablespace 
     318 
     319=item * /home/whatever/xxx 
     320 
     321=item * /media/ssd 
     322 
     323=back 
     324 
     325generated DATA tarball will contain 2 directories: 
     326 
     327=item * data - copy of /var/lib/pgsql/data 
     328 
     329=item * tablespaces - which contains full directory structure leading to: 
     330 
     331=over 
     332 
     333=item * tablespaces/mnt/san/tablespace - copy of /mnt/san/tablespace 
     334 
     335=item * tablespaces/home/whatever/xxx - copy of /home/whatever/xxx 
     336 
     337=item * tablespaces/media/ssd - copy of /media/ssd 
     338 
     339=back 
     340 
     341=back 
     342 
     343Thanks to this approach, if you'll create symlink "tablespaces" pointing to root 
     344directory (I<ln -s / tablespaces>) B<before> exploding tarball - all tablespace 
     345files will be created already in correct places. This is of course not 
     346necessary, but will help if you'd ever need to recover from such backup. 
     347 
    297348=head2 EXAMPLES 
    298349 
  • trunk/omnipitr/doc/omnipitr-backup-slave.pod

    r179 r215  
    275275Filename template is evaluated at start, so any timestamp (^? markers) will 
    276276relate to date/time of beginning of backup process. 
     277 
     278=head2 TABLESPACES 
     279 
     280If I<omnipitr-backup-master> will detect additional tablespaces, they will be 
     281also compressed to generated tarball. 
     282 
     283Since full path to tablespace directory is important, and should be preserved, 
     284and normally tar doesn't let you store files which path starts with "/" (as it 
     285would be dangerous), I<omnipitr-backup-master> uses following approach: 
     286 
     287all tablespaces will be stored in tar, and upon extraction they will be put in 
     288directory "tablespaces", and under it - there will be full path to tablespace 
     289directory. 
     290 
     291For example: 
     292 
     293Assuming PostgreSQL PGDATA is in /var/lib/pgsql/data, and it has 3 extra 
     294tablespaces placed in: 
     295 
     296=over 
     297 
     298=item * /mnt/san/tablespace 
     299 
     300=item * /home/whatever/xxx 
     301 
     302=item * /media/ssd 
     303 
     304=back 
     305 
     306generated DATA tarball will contain 2 directories: 
     307 
     308=item * data - copy of /var/lib/pgsql/data 
     309 
     310=item * tablespaces - which contains full directory structure leading to: 
     311 
     312=over 
     313 
     314=item * tablespaces/mnt/san/tablespace - copy of /mnt/san/tablespace 
     315 
     316=item * tablespaces/home/whatever/xxx - copy of /home/whatever/xxx 
     317 
     318=item * tablespaces/media/ssd - copy of /media/ssd 
     319 
     320=back 
     321 
     322=back 
     323 
     324Thanks to this approach, if you'll create symlink "tablespaces" pointing to root 
     325directory (I<ln -s / tablespaces>) B<before> exploding tarball - all tablespace 
     326files will be created already in correct places. This is of course not 
     327necessary, but will help if you'd ever need to recover from such backup. 
    277328 
    278329=head2 EXAMPLES