Am new to linux cron job, i am using mysql DB, my database name finaldb, i want to take this database every one hour,
I have folder called dailbackup, in this i have fol
Create a PHP Script containing the following:
$dbFile = 'final_db'.date('H').'.sql.gz';
$dbHost = 'localhost'; // Database Host
$dbUser = 'username'; // Database Username
$dbPass = 'password'; // Database Password
exec( 'mysqldump --host="'.$dbHost.'" --user="'.$dbUser.'" --password="'.$dbPass.'" --add-drop-table "finaldb" | gzip > "'.$dbFile.'"' );