1

Hi this is Ravindra and i have one question that i want to copy table data from one database server to another pc database server periodically after 7 or 10 days automatically in linux through cron job Can Any one help me out plz

1 Answer 1

0

First of all you want to set up Master Slave Replication in MySQL. All steps are clearly explained in this site.

Next, you need to create a shell scripts that contains mysql connection and the commands to start/stop replication.

STOP SLAVE;

START SLAVE;

Last, you need to set up a cron job to run the shell scripts similar to this.

# Minute   Hour   Day of Month   Month  Day of Week   Command    
# (0-59)  (0-23)     (1-31)     (1-12)    (0-6)                
    0       0           *          *        1           sh shell_script.sh
1
  • In command section, "sh" in shell_script.sh is necessary?
    – ravindra
    Apr 23, 2018 at 4:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .