2
Contributors
9
Replies
14
Views
7 Years
Discussion Span
Last Post by tejasluvs
0

Is there a specific reason you want to do it with PHP ? If you use a shell script it can be as small as this:

#!/bin/sh
DATE=`/bin/date +"%G%m%d"` ;
mysqldump --host=localhost --user=YOURUSER --password=YOURPASSWORD --all-databases --single-transaction --quick | gzip > ./YOURFILEPATH/backup-$DATE.sql.gz ;
0

Is there a specific reason you want to do it with PHP ? If you use a shell script it can be as small as this:

#!/bin/sh
DATE=`/bin/date +"%G%m%d"` ;
mysqldump --host=localhost --user=YOURUSER --password=YOURPASSWORD --all-databases --single-transaction --quick | gzip > ./YOURFILEPATH/backup-$DATE.sql.gz ;

Can you please guide me how to get the shell script do the job for me? I have not used shell scripts before.

0

You can save these 3 lines as 'backup.sh' and use it when setting up your cron job. For help on setting up your cronjob, see the cpanel documentation.

Edited by pritaeas: n/a

0

You can save these 3 lines as 'backup.sh' and use it when setting up your cron job. For help on setting up your cronjob, see the cpanel documentation.

Thanks for the hint and guidance.

0

Thanks for the hint and guidance.

Thanks,

The command works for me. Could you please help me little bit more? what will be the parameter for backing up a single or multiple table?

0

The first example on the page ...

mysqldump --host=localhost --user=YOURUSER --password=YOURPASSWORD YOURDATABASE YOURTABLE
0

The first example on the page ...

mysqldump --host=localhost --user=YOURUSER --password=YOURPASSWORD YOURDATABASE YOURTABLE

Thanks, I really appreciate your efforts to help me out.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.