Tim, Thanks, that did the trick. One thing, I tried to zip the files up and I get permission denied when I attempt to do that with the command below. All of the files are there, but they don't get zipped up. I also notice that the txt files and the sql files have slightly different ownership. The group owner is different. Any ideas? Thanks, Kelly
Script: #!/bin/sh date=`date -I` sudo su - mkdir /usr/local/mysql/bakups/$date chown root.mysql /usr/local/mysql/bakups/$date chmod 770 /usr/local/mysql/bakups/$date /usr/local/mysql/bin/mysqldump --tab=/usr/local/mysql/bakups/$date --opt webcollab | bz2 -c > /usr/local/mysql/bakups/$date/webcollab_backup-$date.sql.bz2 ---------------------- Kelly S. Brace Information Technology Exchange Center Twin Rise 200 1300 Elmwood Avenue Buffalo, NY 14222 http://www.itec.suny.edu Main: 716-878-4832 Fax: 716-878-3485 Office: 716-878-3895 Cell: 716-432-4978 [EMAIL PROTECTED] Tom Crimmins <[EMAIL PROTECTED]> 03/03/2005 03:06 PM To [EMAIL PROTECTED] cc mysql@lists.mysql.com Subject RE: backup scripts Kelly, You can find out what user mysqld is running as with the following: #ps axu | grep mysqld To change the permissions on the directory run the following as root: #chown mysql.mysql /usr/local/mysql/bakups #chmod 770 /usr/local/mysql/bakups If it is a different user, substitute it in for mysql in the first command. -- Tom Crimmins Interface Specialist Pottawattamie County, Iowa On Thursday, March 03, 2005 13:58, [EMAIL PROTECTED] wrote: > Tom, > I seem to be having difficulty allowing the mysqld user wx privs on > the /backup folder. I read the following, but I don't see how to > allow mysqld to w and x to that directory: > http://dev.mysql.com/doc/mysql/en/mysqldump.html > > Kelly > > On Thursday, March 03, 2005 13:12, [EMAIL PROTECTED] > wrote: > > Hi Kelly, > >> Hello, >> When I attempt to try and run the backup: >> >> shell> mysqldump --tab=/path/to/some/dir --opt db_name >> I get the following errors: >> ./mysqldump: Got error: 1: Can't create/write to file >> '/usr/local/mysql/bakups/config.txt' (Errcode: 13) when executing >> 'SELECT INTO OUTFILE' > > [EMAIL PROTECTED] tom]$ perror 13 > Error code 13: Permission denied > > You need to make sure that the user mysqld is running as has write and > execute permission to /usr/local/mysql/bakups. > > Read the following page. Specifically the part about the tab option. > http://dev.mysql.com/doc/mysql/en/mysqldump.html > >> Or: >> >> shell> mysqlhotcopy db_name /path/to/some/dir >> DBI->connect(;host=localhost;mysql_read_default_group=mysqlhotcopy) >> failed: Client does not support authentication protocol requested by >> server; consider upgrading MySQL client at ./mysqlhotcopy line 178 > > You need a newer version of DBD-mysql (you can get this from CPAN), > or you can use the old password option. > > http://dev.mysql.com/doc/mysql/en/old-client.html > >> I followed the directions from: >> http://dev.mysql.com/doc/mysql/en/backup.html >> >> I also attempted to follow these directions, to no avail: >> ---------------------------------- >> mysqlhotcopy, etc is great - but using it (and most other myql >> automation scripts) requires placing a user/password on the command >> line for all/some to see (ps axw) >> There doesn't appear to be a way to place the user/pass into a file >> somewhere and specify only that (secured) filename on the command >> line. I get around this in the case of mysqlhotcopy by taking a >> local copy of the script (perl) and hard-coding the auth info into >> that copy thus: >> >> mysqlhotcopy - line 164ish: >> >> my $dbh = >> DBI->connect("dbi:mysql:$dsn;mysql_read_default_group=mysqlhotcopy", >> 'backup_user', 'backup_password'}, >> >> and again at around line 745: >> >> my $dbh = >> > DBI->connect("dbi:mysql:${db}${dsn};mysql_read_default_group=mysqlhotcopy", >> "backup_user", "backup_password", >> >> then, just to be sure, >> >> chown root.nobody mysqlhotcopy >> chmod 700 mysqlhotcopy >> -------------------------------- >> Any ideas would be greatly appreciated. I would really like to add >> this to a cronjob to have it run automatically. Thanks in advance!