Re: exec problem

From: Date: Tue, 31 Jul 2001 13:53:40 +0000
Subject: Re: exec problem
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-60406@lists.php.net to get a copy of this message
if you have a shell account write a batch file and install it in the crontab of the user whihc mysql runs under. i did this at work for a postgresql database and it owrks perfectly. something like this will work. crontab -u <user> -e add: 30 7-19/2,23 * * * /backup/dumpit which runs /backup/dumpit every 2 hours at 30 mins past the hour between 7am and 7 pm and then again at 11 pm dumpit consists of: #!/bin/sh backdate=$(date +%Y%m%d%H%M.gz) /usr/local/pgsql/bin/pg_dump XXX | gzip > /backup/edb-backup_$backdate cp /backup/edb-backup_$backdate /var/autofs/misc/ecalnet/ so i effect the file creates a file called edb-backup_<date and time> which is a zipped copy of the dump file. should be simple for you to substitute the mysql dump commands etc. Steve <KPortsmout@aol.com> wrote in message news:122.27af726.2898033d@aol.com... > Hi I'm trying to create a script which my cron will run once a day to backup > my MySQL database, but the exec command doesn't want to work no matter what I > try... > > exec("mysqldump -h localhost -u user -p pass --opt DataBase > > BACKUPS/backup.mysql") or die("Problem"); > > I have tried adding the full path to mysqldump, I have tried using my root > access, I have tried using a different dir to store the files, changed > permissions all sorts and nothing works. It always returns "Problem" and if I > take out the or die then it just returns a blank screen. I also tried system > () and that gave the same results. > > Anyone have any other ideas??? > > TIA > > > __________________ > -Ade > > ~~Good things come to those who wait~~

« previous php.general (#60406) next »