3 # shell script to make a dump of the bacula Ingres database using copydb and make
4 # a base64 encoded tar of the content.
9 db_name=${db_name:-@db_name@}
10 db_user=${db_user:-@db_user@}
11 working_dir="@working_dir@"
14 # Source the Ingres settings when they exist.
16 [ -f ${bindir}/../../.ingIIsh ] && . ${bindir}/../../.ingIIsh
19 # See if the dumpdir exists.
21 [ ! -d ${working_dir}/ingres_dump ] && mkdir -p ${working_dir}/ingres_dump
24 # Generate the copy.in and copy.out file
29 -dest=${working_dir}/ingres_dump \
30 -d ${working_dir}/ingres_dump \
34 # If copydb created a copy.out file run it.
36 if [ -f ${working_dir}/ingres_dump/copy.out ]; then
38 # Run the sql to create the dumps of the tables.
43 < ${working_dir}/ingres_dump/copy.out \
44 > /dev/null 2>&1 && rm ${working_dir}/ingres_dump/copy.out
47 # Tar up the dump and uuencode it.
49 cd ${working_dir}/ingres_dump || exit 1
52 tar cf - . | gzip -c | base64
55 tar cf - . | gzip -c | uuencode -m -
58 echo "Unsupported OS type encountered, `uname -s`"
64 rm -rf ${working_dir}/ingres_dump