mysql - database backup with cron jobs in cpanel -
i trying take in cpanel using cron jobs.
my script this
/usr/bin/mysqldump --user=username --password=password --host=localhost dbname | gzip > /home/username/backups/dbbackup_$date.sql.gz
and in backup.sh
#!/bin/bash date=`date +%y%m%d_%k%m`; /usr/bin/mysqldump --user=username --password=password --host=localhost dbname | gzip > /home/username/backups/dbbackup_$date.sql.gz
and have set time every 5 mins. not happening. please suggest me doing wrong
can give exact line of cron job? tried this:
date=`date +%y%m%d_%k%m` mysqldump -uroot -p12345 -h127.0.0.1 db | gzip > /home/ubuntu/root/db_$date.sql.gz
and worked me, may there problem cron!!
to run every 5 minutes syntax:
*/5 * * * * sh /home/ubuntu/root/backupscript.sh
Comments
Post a Comment