VBoxManage list runningvms
To start-up a virtualBox VM:
VBoxManage startvm {The VM Name, e.g. CateringSys, Case-sensitive} --type headless
The correct response:
Waiting for VM "{The VM Name}" to power on...
VM "{The VM Name}" has been successfully started
To Synchronize Two MySQL Databases
(Override A with B - Override (database to be updated) with (The most updated database) )
On the most updated server(B), run the following command:
mysqldump -u {The MySQL username} --password={The password} {The database name} | mysql -u {The remote MySQL's username} --password={The remote MySQL's password} --host={The remote host's IP, e.g. 192.168.1.40 or external IP} {The remote database name}
So as to synchronize data to the remote server (A).
Schedule database backup:
crontab -e
# Inside the crontab file
# * Output a .sql backup file
# Say, do the following at 3:00 a.m. daily
# Note that slash is needed for escaping character '%', and ':' in the file name is prohibited
0 3 * * * mysqldump -u {The MySQL username} --password={The password} {The database name} > {The directory path for storing the backup .sql file, e.g. [/home/me/mysql_backup/]}{file name, e.g. [mysql_backup_`data +\%Y=\%m-\%d_\%H=\%M-\%S`.sql]} 2>&1
# * Synchronize to the other database
# Say, do the following at 4:00 p.m. daily
0 16 * * * mysqldump -u {The MySQL username} --password={The password} {The database name} | mysql -u {The remote MySQL's username} --password={The remote MySQL's password} --host={The remote host's IP, e.g. 192.168.1.40 or external IP} {The remote database name} 2>&1
Save the file. Done.
For more details about crontab, please read http://linux.vbird.org/linux_basic/0430cron.php .
沒有留言:
張貼留言