If you use an API application, you don't even need to schedule a sync. You can keep the API connection on, and sync as soon as an item is added or removed to the address list.
e.g. with PHP (run from command line, not a web page!)
<?php
use PEAR2\Net\RouterOS;
require_once 'PEAR2_Net_RouterOS-1.0.0b5.phar';
$master = new RouterOS\Client('master-router-ip', 'admin', 'password');
$slaveUtil = new RouterOS\Util($slave = new RouterOS\Client('slave-router-ip', 'admin', 'password'));
$slaveUtil->setMenu('/ip firewall address-list');
$addressLists = array('List1', 'List2');
$master->sendAsync(
new RouterOS\Request('/ip firewall address-list listen'),
function ($response) use ($addressLists, $slave, $slaveUtil) {
if (in_array($response('list'), $addressLists, true)) {
if (null !== $response('.dead')) {
//Removed
$slaveUtil->remove(
$slaveUtil->find(
RouterOS\Query::where('list', $response('list'))->andWhere('address', $response('address'))
)
);
} else {
//Added
$slaveUtil->add(
array(
'list' => $response('list'),
'address' => $response('address')
)
);
}
}
}
);
$master->loop();
Or if you insist on not using a 3rd device, you can use something similar to jurgenskrause's suggestion... Except that his can be implemented in a more simple and efficient fashion...
On the master, schedule:
#Semicolon separated list of Address Lists you want to sync
:local lists {"List1";"List2"}
#Filename of export (must match receiving router import filename)
:local exportFile "ExportAddressList.rsc"
:local fileContents "/ip firewall address-list\n"
:foreach i in=$lists do={
:set $fileContents ($fileContents . "remove [find list=\"" . $i . "\"]\n")
:foreach j in=[/ip firewall address-list print as-value where list=$i] do={
:set $fileContents ($fileContents . "add list=\"" . ($j->"list") . "\" address=\"" . ($j->"address") . "\"\n")
}
}
#Only the first time
:if ([/file print count-only where name=$exportFile] = 0) {
/file print file=$exportFile
:delay 2s
}
/file set $exportFile contents=$fileContents
On slave, schedule:
#Filename of export (must match receiving router import filename)
:local importFile "ExportAddressList.rsc"
#IP Address of router with existing address list(s)
:local hostIP 1.2.3.4
#FTP Username and Password
:local ftpUser username
:local ftpPassword userpassword
/tool fetch address=$hostIP src-path=$importFile dst-path=$importFile mode=ftp user=$ftpUser password=$ftpPassword
/import $importFile