• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/bash
2#
3# A cron job may call this with a line such as:
4#     37 7 * * * sh /home/cldrbackup/backup.sh >/dev/null 2>&1
5
6DATABASE_NAME={{ cldr_database_name }}
7FNAME={{ cldr_database_name }}-DUMP-`date +%Y-%m-%d`
8RSYNC_DEST={{ cldr_db_backup_destination }}
9
10cd /home/cldrbackup
11mysqldump ${DATABASE_NAME} --add-drop-table --create-options --default-character-set=utf8mb4 > ${FNAME}.sql
12xz ${FNAME}.sql
13rsync -q ${FNAME}.sql.xz ${RSYNC_DEST}
14