I have wirtten this line in /etc/crontab file to take daily dump from one database to another every night at 3, but doesn’t wrok neither does it give any error messages.
0 3 * * * mysqldump -uroot -ppassword --opt activeDB | mysql -uroot -ppassword -h test.example.com passiveDB
Any idea what is wrong here? Do I need to define for example a ssh connection for the server? If that is the problem, I guess it should give some message like connection to the given server is not allowed, no?
Write your command to a shell script, and call that script from the crontab. Some versions of cron dont read multi-part commands very well.
You should debug your command first, before setting it up in a cron.
You need to make sure that
mysqldis listening on the public interface attest.example.com(it isn’t by default). You need to make sure you have the correctGRANTpermissions set up on the remote database, you need to grant permissions to ‘user’@’%’ (bad idea) or ‘user’@’your-active-server-ip’ (better idea).