Date: Mon, 23 Feb 2009 19:41:41 +0100 From: Peter Boosten <peter@boosten.org> To: Joseph Simmons <josephdsimmons@gmail.com> Cc: Christopher Umina <chris@easymac.org>, freebsd-questions@freebsd.org Subject: Re: root's crontab and mysqldump Message-ID: <49A2EDE5.8040600@boosten.org> In-Reply-To: <1ba9cd9a0902231026t797dd129t2b54e86bb874bbf0@mail.gmail.com> References: <1ba9cd9a0902230937xc817f3dxe26a54b734d5f8ef@mail.gmail.com> <BC19BF4C-9A21-45F0-B140-0552761941E7@easymac.org> <1ba9cd9a0902231026t797dd129t2b54e86bb874bbf0@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Joseph Simmons wrote:
> I added the full path and the result didn't change. I can still see it
> running in the log but the script doesn't appear to be doing anything.
>
> I have the following variables set in the root's crontab
>
> SHELL=/usr/local/bin/bash
> PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin
> HOME=/root
>
> The file I'd like to execuate has the following permissions
>
> rwxr-x---
>
> it's own by root, the contents of the file are below
>
> #!/usr/local/bin/bash
> date_time=$(/bin/date "+%Y-%m-%d-%H-%M-%S")
>
> /usr/local/bin/mysqldump -u backup_user -pPassWord DataBase
>
>> /backup/db/DataBase-$date_time
>>
>
>
I run the same script, however without the credentials. Those are in
~/.my.cnf
[client]
user = backupuser
password = thepassword
host = the.host.name
my backup script:
*******
ra% cat bkupdb
#!/bin/sh
DATUM=`date +%Y%m%d`
nice -19 /usr/local/bin/mysqldump -A --single-transaction >
/home/peter/backup/mysql-${DATUM}.sql
gzip /home/peter/backup/mysql-${DATUM}.sql
******
nb: DATUM = Dutch for date
Peter
--
http://www.boosten.org
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?49A2EDE5.8040600>
