Date: Thu, 14 Feb 2002 14:39:41 -0000 From: "James Green" <james@stealthnet.co.uk> To: <freebsd-questions@freebsd.org> Subject: RE: 4.5-release: Weird problem with mysqldump and permissions(?) Message-ID: <IGEPIJPNHPMGCANGLCBHEEKHCBAA.james@stealthnet.co.uk> In-Reply-To: <20020214142524.75235.qmail@web13403.mail.yahoo.com>
next in thread | previous in thread | raw e-mail | index | archive | help
OK here goes #!/usr/local/bin/bash ROOTDIR=/usr/local/www/xx.xx.xx.xxx/dbdumps TODAY=`date -j -u "+%Y-%m-%d"` FILENAME=$ROOTDIR/$TODAY MYSQL=/usr/local/bin/mysqldump USER="root" PASSWD="xxxxxxxx" DATABASE="mobilecontent" TABLES="categories charts freeids logos paste_errors phonemanufacturers \ phones phoneservicecompatibility ringtonegenre ringtones serviceproviders \ serviceproviderservicecompatibility services useraccounts voicemails" mkdir -p $ROOTDIR; mkdir -p $FILENAME; cd $ROOTDIR; $MYSQL -u $USER -p$PASSWD $DATABASE $TABLES > $FILENAME".mysqldump"; $MYSQL -u $USER -p$PASSWD --no-create-info $DATABASE $TABLES > $FILENAME".mysqldata"; $MYSQL -u $USER -p$PASSWD -T $FILENAME $DATABASE $TABLES; tar -czf $TODAY".mysqlsep.tar.gz" "$FILENAME/"; ln -sf $FILENAME".mysqldump" "latest.mysqldump"; ln -sf $FILENAME".mysqldata" "latest.mysqldata"; ln -sf $FILENAME".mysqlsep.tar.gz" "latest.mysqlsep.tar.gz"; > --- James Green <james@stealthnet.co.uk> wrote: > > Hi all, > > > > We're trying to back up our database using mysqldump > > in various formats. We > > have a shell script to do this and it works > > perfectly on one freebsd machine > > but not on another. > > > > Here is the error: > > > > r2b% ./dbdump.sh > > /usr/local/bin/mysqldump: Got error: 1: Can't > > create/write to file > > > '/usr/local/www/xx.xx.xx.xxx/dbdumps/2002-02-14/categories.txt' > > (Errcode: > > 13) when executing 'SELECT INTO OUTFILE' > > tar: Removing leading / from absolute path names in > > the archive. > > r2b% touch > > > /usr/local/www/xx.xx.xx.xxx/dbdumps/2002-02-14/categories.txt > > r2b% > > > > As you can see there's no problem with me > > creating/writing the file. > > categories.ext was created fine, but the .txt file > > doesn't like being done. > > > > r2b% df -h > > Filesystem Size Used Avail Capacity Mounted > > on > > /dev/ad0s1a 126M 31M 85M 27% / > > /dev/ad0s1f 252M 8.0K 232M 0% /tmp > > /dev/ad0s1g 25G 1.1G 22G 5% /usr > > /dev/ad0s1e 252M 4.8M 227M 2% /var > > procfs 4.0K 4.0K 0B 100% /proc > > > > So no problem with disk space. MySQL uses /var/tmp > > for temporary space, and > > the permissions there are fine. > > > > Other MySQL dumps of the same tables work fine (in > > other formats) but not > > this one (it's the one that dumps a file for table > > structure and another for > > table data). > > > > I'm at a loss to explain it. Any ideas out there > > would be appreciated :). > > > > Thanks, > > > > -- > > James Green > > Developer > > Stealthnet.co.uk > > Please provide the contents of dbdump.sh. > > Andrew Gould To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?IGEPIJPNHPMGCANGLCBHEEKHCBAA.james>