A hydraulic drive device for a working machine, comprising: a hydraulic pump (1a, 1b); an actuator (5a, 5b) driven by pressure oil from the hydraulic pump (1a, 1b); a first on-off valve (25a, 25c) opening/closing a flow passage between the hydraulic pump (1a, 1b) and the actuator (5a, 5b); a second on-off valve (25b, 25d) arranged in parallel with the first on-off valve (25a, 25c) and opening/closing a flow passage between the hydraulic pump (1a, 1b) and the actuator (5a, 5b); a first directional switching valve (30a, 30c) capable of switching between a first position and a second position, the first position allowing the first on-off valve (25a, 25c) and the actuator (5a, 5b) to communicate with each other, and the second position shutting off the first on-off valve (25a, 25c) and the actuator (5a, 5b) from each other; a second directional switching valve (30b, 30d) capable of switching between a third position and a fourth position, the third position shutting off the second on-off valve (25b, 25d) and the actuator (5a, 5b) from each other, and the fourth position allowing the second on-off valve (25b, 25d) and the actuator (5a, 5b) to communicate with each other; a recording device recording an operation state of the first on-off valve (25a, 25c) and the second on-off valve (25b, 25d) with lapse of time; and a controller controlling switching operation of the first directional switching valve (30a, 30c) and the second directional switching valve (30b, 30d) based on history data with respect to an operation state of the first on-off valve (25a, 25c) and the second on-off valve (25b, 25d) recorded in the recording device, wherein the controller opens the first on-off valve (25a, 25c), closes the second on-off valve (25b, 25d), switches the first directional switching valve (30a, 30c) to the first position, switches the second directional switching valve (30b, 30d) to the third position, thereby supplies pressure oil from the hydraulic pump (1a, 1b) from the first on-off valve (25a, 25c) to the actuator (5a, 5b) through the first directional switching valve (30a, 30c), and when the history data of the first on-off valve (25a, 25c) is determined to satisfy a prescribed condition, closes the first on-off valve (25a, 25c), opens the second on-off valve (25b, 25d), switches the first directional switching valve (30a, 30c) to the second position, switches the second directional switching valve (30b, 30d) to the fourth position, and thereby supplies pressure oil from the hydraulic pump (1a, 1b) from the second on-off valve (25b, 25d) to the actuator (5a, 5b) through the second directional switching valve (30b, 30d). a hydraulic pump (1a, 1b); an actuator (5a, 5b) driven by pressure oil from the hydraulic pump (1a, 1b); a first on-off valve (25a, 25c) opening/closing a flow passage between the hydraulic pump (1a, 1b) and the actuator (5a, 5b); a second on-off valve (25b, 25d) arranged in parallel with the first on-off valve (25a, 25c) and opening/closing a flow passage between the hydraulic pump (1a, 1b) and the actuator (5a, 5b); a first directional switching valve (30a, 30c) capable of switching between a first position and a second position, the first position allowing the first on-off valve (25a, 25c) and the actuator (5a, 5b) to communicate with each other, and the second position shutting off the first on-off valve (25a, 25c) and the actuator (5a, 5b) from each other; a second directional switching valve (30b, 30d) capable of switching between a third position and a fourth position, the third position shutting off the second on-off valve (25b, 25d) and the actuator (5a, 5b) from each other, and the fourth position allowing the second on-off valve (25b, 25d) and the actuator (5a, 5b) to communicate with each other; a recording device recording an operation state of the first on-off valve (25a, 25c) and the second on-off valve (25b, 25d) with lapse of time; and a controller controlling switching operation of the first directional switching valve (30a, 30c) and the second directional switching valve (30b, 30d) based on history data with respect to an operation state of the first on-off valve (25a, 25c) and the second on-off valve (25b, 25d) recorded in the recording device, wherein the controller opens the first on-off valve (25a, 25c), closes the second on-off valve (25b, 25d), switches the first directional switching valve (30a, 30c) to the first position, switches the second directional switching valve (30b, 30d) to the third position, thereby supplies pressure oil from the hydraulic pump (1a, 1b) from the first on-off valve (25a, 25c) to the actuator (5a, 5b) through the first directional switching valve (30a, 30c), and when the history data of the first on-off valve (25a, 25c) is determined to satisfy a prescribed condition, closes the first on-off valve (25a, 25c), opens the second on-off valve (25b, 25d), switches the first directional switching valve (30a, 30c) to the second position, switches the second directional switching valve (30b, 30d) to the fourth position, and thereby supplies pressure oil from the hydraulic pump (1a, 1b) from the second on-off valve (25b, 25d) to the actuator (5a, 5b) through the second directional switching valve (30b, 30d).