1. Technical Field
The present disclosure relates to an electronic device with data backup function and a data backup method.
2. Description of Related Art
Generally, a server includes a Baseboard Management Controller (BMC), a number of sensors, and other elements, such as a mainboard, a fan, and so on. The BMC detects performance of the server, such as a mainboard voltage, a fan speed, temperatures of elements, through the sensors. If an element operates outside pre-determined ranges of parameters, the BMC generates a system event log (SEL) and stores the SEL to a SEL area which can be accessed by users. However, because the storage space of the SEL area is limited, and when the SEL is full, subsequent logs will either not be stored or previous logs are overwritten.
The components of the drawings are not necessarily drawn to scale, the emphasis instead being placed upon clearly illustrating the principles of the present disclosure. Moreover, in the drawings, like reference numerals designate corresponding parts throughout several views.
The processor 10 controls to back up the data stored in the first storage unit 11 to the second storage unit 12. The method for backing up the data stored in the first storage unit 11 to the second storage unit 12 is illustrated in
In step S201, the processor 10 checks the amount of storage space in use of the first storage unit 11. In the embodiment, the amount of storage space in use of the first storage unit 11 is determined according to the number of the logs stored in the first storage unit 11.
In step S202, if step S201 has been performed previously, the processor 10 compares the current amount of used storage space of the first storage unit 11 checked this time with a previous amount of used storage space of the first storage unit checked previously to determine whether the current amount of used storage space is greater than the previous amount of used storage space. If the current amount of used storage space is not greater than the previous amount of used storage space, the procedure goes back to step S201. If the current used storage space is greater than the current used storage space, the procedure goes to step S203. If this is the first time step S201 has been performed, 0 is taken as the previous amount of used storage space.
In step S203, the processor 10 obtains the data that was stored in the storage space of the first storage unit 11 since the previous check.
In step S204, the processor 10 determines whether the first storage unit 11 is full. If the first storage unit 11 is not full, the procedure goes to step S202. If the first storage unit 11 is full, the procedure goes to step S205.
In step S205, the processor deletes all the data stored in the first storage unit 11 and records the previous amount of used storage space to 0.
In other embodiments, the data stored in the first data storage 11 are not limited to the SEL, the other real time data generated by the BMC 10 and stored in the first data storage 11 can also be backed up to the second data storage 12 using the method described above.
In the embodiment, one or more programs which the processor 10 implements may be embedded in firmware, such as in an erasable programmable read-only memory (EPROM) device.
Although the present disclosure has been specifically described on the basis of preferred embodiments, the disclosure is not to be construed as being limited thereto. Various changes or modifications may be made to the embodiment without departing from the scope and spirit of the disclosure.
Number | Date | Country | Kind |
---|---|---|---|
201210043509.5 | Feb 2012 | CN | national |