3 T=$(mktemp -d -t -p /var/tmp chef-server.XXXXXXXXXX)
5 B=chef-server-$D.tar.gz
7 mkdir $T/chef-server-$D
8 chgrp opscode-pgsql $T $T/chef-server-$D
9 chmod g+rwx $T $T/chef-server-$D
10 sudo -u opscode-pgsql /opt/opscode/embedded/bin/pg_dumpall --file=$T/chef-server-$D/chef.dmp --clean
11 ln -s /var/opt/opscode/bookshelf/data $T/chef-server-$D/bookshelf
13 nice tar --create --dereference --directory=$T chef-server-$D | nice gzip --rsyncable -9 > $T/$B
14 nice rsync --preallocate --fuzzy $T/$B backup.openstreetmap.org::backup