Friday, February 18, 2022

[SOLVED] Cron job for backup a database to github

Issue

I created a cron job to create a dump of my mysql database and add it to my github repo. But it doesn’t push it to the master it works until the commit. But it doesn’t push it.

/usr/local/mysql/bin/mysqldump -u root -proot1234 core > ~/dbdump/dump.sql

cd ~/dbdump
git add dump.sql
git commit -m "test"
git push origin master
*/5 * * * * /Users/Anjula/test.sh

Solution

The problem was I haven’t set up the ssh keys



Answered By - Anjula Samarasinghe
Answer Checked By - Candace Johnson (WPSolving Volunteer)