标签:
直接上sql:
SELECT v.name AS vm_instance_name, v.vo_name AS volume_name, DATE_FORMAT(DATE_ADD(sn.scheduled_timestamp, INTERVAL 8 HOUR), ‘%y-%m-%d %H:%i:%s %W‘) AS next_schedule_date FROM cloud.snapshot_schedule AS sn JOIN (SELECT vo.id AS vo_id, vo.name AS vo_name, vm.id, vm.name FROM cloud.vm_instance AS vm JOIN cloud.volumes AS vo ON vm.id = vo.instance_id) AS v ON sn.volume_id = v.vo_id;
显示3个字段
实例名称 卷名称 下次执行时间
这个时间是通过+8得出来的
效果如下图:
+------------------+-------------+----------------------------+ | vm_instance_name | volume_name | next_schedule_date | +------------------+-------------+----------------------------+ | xxx | ROOT-85 | 15-08-30 01:00:00 Sunday | | xxx | ROOT-87 | 15-08-30 01:00:00 Sunday | | xxx | xxxx | 15-08-29 01:00:00 Saturday | | xxx | ROOT-361 | 15-08-30 01:00:00 Sunday | | xxx | ROOT-365 | 15-08-29 01:00:00 Saturday | +------------------+-------------+----------------------------+
标签:
原文地址:http://my.oschina.net/firxiao/blog/498229