Change mysql-backup cron job to get home directory path from passwd database instead hardcoding.
This commit is contained in:
parent
e447fa5233
commit
38edd3366d
1 changed files with 1 additions and 1 deletions
|
@ -4,7 +4,7 @@ DESTDIR="<%= mysql_backup_datadir %>"
|
||||||
MAXAGE="<%= mysql_backup_maxage %>"
|
MAXAGE="<%= mysql_backup_maxage %>"
|
||||||
|
|
||||||
DATE=`date "+%Y-%m-%d"`
|
DATE=`date "+%Y-%m-%d"`
|
||||||
HOME="/root"
|
HOME="`getent passwd ${USER} | cut -d : -f 6`"
|
||||||
|
|
||||||
if [ ! -d ${DESTDIR} ]; then
|
if [ ! -d ${DESTDIR} ]; then
|
||||||
echo "ERR: MySQL backup directory [${DESTDIR}] does not exist" 1>&2
|
echo "ERR: MySQL backup directory [${DESTDIR}] does not exist" 1>&2
|
||||||
|
|
Loading…
Add table
Reference in a new issue