Metacat Backup Procedure ======================== There are times when the Coordinating Nodes only need a new version of Metacat installed using the dataone-cn-metacat debian package. In this case, the Metacat database and the on-disk files should be backed up to an off-site server. First, dump the PostgeSQL database to a file in `/var/metacat`, and then send the entire `/var/metacat` directory over ssh in tar-gzipped format to an off-site server. In this example, we use the knb.ecoinformatics.org server since it has a large amount of disk space that is independent of the DataONE storage clusters. Backup the CN database ---------------------- Use the pg_dump command to backup the `metacat` database. :: $ sudo mkdir /var/metacat/backups $ sudo chown postgres /var/metacat/backups $ sudo su - postgres -c \ "pg_dump -Fc -f /var/metacat/backups/$(hostname)-metacat-dump-$(date +%Y%M%d%H%M).sqlc metacat" Transfer the files offsite ------------------------- On each CN, open a screen session so that terminal disconnections don't interrupt the data transfer. If you haven't sudo'd recently, you will be prompted for your password. You may also be prompted for your remote password on the backup server, or may be asked to accept the SSH certificate. When piping data over SSH, you may not see these prompts, so just be aware that you'll need to type in your password a couple times. The alternative is to set up DSA authentication in SSL, and you'll only be prompted for your sudo password. On the remote machine, ensure the backup directory is present and writable :: cjones@knb $ sudo mkdir /var/backups/dataone cjones@knb $ sudo chown cjones /var/backups/dataone Then do the backup from the CN, in this case, cn-stage-unm-1 :: $ screen $ sudo tar czvf - /var/metacat | \ ssh cjones@knb.ecoinformatics.org \ "cat > /var/backups/dataone/cn-stage-unm-1-var-metacat-backup-$(date +%Y%m%d%H%M).tgz" From remote machines, I seemed to have gotten transfer rates of about 3.5 MB/s, and from UCSB CNs, 4.5 MB/s.