Commit 3cddd124 authored by Hugo Hörnquist's avatar Hugo Hörnquist
Browse files

Move backup-mysql to own script.

parent 25ba83da
#!/bin/bash
# fail faster
set -e
TMPFILE=$(/bin/mktemp /var/tmp/fulldump.sql.XXX)
/usr/bin/mysqldump --all-databases --events > "$TMPFILE"
mv "$TMPFILE" /var/lib/mysql-dump/fulldump.sql
......@@ -60,8 +60,14 @@ class datorhandbok (
mode => '0755',
}
file { '/var/lib/mysql-dump/run.sh':
ensure => file,
chmod => '0755',
source => 'puppet:///modules/datorhandbok/mysql-dump.sh',
}
cron { 'backup-mysql':
command => 'TMPFILE=`/bin/mktemp /var/tmp/fulldump.sql.XXX` && /usr/bin/mysqldump --all-databases --events > "$ TMPFILE" && mv "$TMPFILE" /var/lib/mysql-dump/fulldump.sql',
command => '/var/lib/mysql-dump/run.sh',
user => 'root',
hour => 3,
minute => 11;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment