forked from quickshiftin/mysqlbkup
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall
More file actions
executable file
·29 lines (25 loc) · 939 Bytes
/
install
File metadata and controls
executable file
·29 lines (25 loc) · 939 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash
# --------------------------------------------------------------------------------
# mysqlbkup
# (c) Nathan Nobbe 2014
# http://quickshiftin.com
# quickshiftin@gmail.com
#
# Installation script for mysqlbkup utility.
# --------------------------------------------------------------------------------
# Deploy the executable
cp mysqlbkup.sh /usr/local/bin
chmod 755 /usr/local/bin/mysqlbkup.sh
# Deploy the configuration files
cp mysqlbkup.config.sample /etc/mysqlbkup.config
chmod 600 /etc/mysqlbkup.config
cp mysqlbkup.cnf.sample /etc/mysqlbkup.cnf
chmod 600 /etc/mysqlbkup.cnf
# Create the backup directory
. /etc/mysqlbkup.config
mkdir "$BACKUP_DIR"
chmod 600 "$BACKUP_DIR"
# Inform the user about important manual steps
echo "mysqlbkup is installed"
echo "Setup cron to run once a day"
echo "3 3 * * * /usr/local/bin/mysqlbkup.sh 1>> /var/www/mysql_database/mysqlbkup.log 2>> /var/www/mysql_database/mysqlbkup-err.log"