klipper-backup icon indicating copy to clipboard operation
klipper-backup copied to clipboard

[Feature request]: Check that the printer is not running before starting the backup

Open Pelado-Mat opened this issue 10 months ago • 3 comments

Is your feature request related to a problem? Please describe.

I got failed prints on my setup, all with a "MCU overloaded" error exactly at the time of the scheduled backup

Describe the solution you'd like

add to the backup script an, perhaps optional, check to skip the backup if the printer is running

# abort if its printing

STATE=$(curl -X GET http://127.0.0.1:7125/printer/objects/query?print_stats 2>/dev/null | grep -oP '(?<="state": ")[^"]*')
if [ "$STATE" = "printing" ]; then
  exit 0
fi

Describe alternatives you've considered

Perhaps moving to a newer rPI, but is working fine besides the backup.

Additional information

No response

Pelado-Mat avatar May 02 '24 20:05 Pelado-Mat

Huh that is interesting what device are you currently running Klipper on as even on a neptune 4 pro which doesn't have the best clone of a mkspi doesn't seem to have issues.

The cron job is also an optional feature and can be modified without affecting the klipper backup repository and causing it to report as dirty. so you could just add that code into a script file that is then called from the cron or directly to the cron command.

Tylerjet avatar May 02 '24 20:05 Tylerjet

Huh that is interesting what device are you currently running Klipper on as even on a neptune 4 pro which doesn't have the best clone of a mkspi doesn't seem to have issues.

The cron job is also an optional feature and can be modified without affecting the klipper backup repository and causing it to report as dirty. so you could just add that code into a script file that is then called from the cron or directly to the cron command.

It's an old rPI 3+ with a dubious SD Card. I have also the rPI driving a Oled screen and keypad using a the rpi as a klipper mcu, perhaps that why is falling.

I'm running that code on my backup script, it working fine.

Pelado-Mat avatar May 02 '24 21:05 Pelado-Mat

Gotcha, What I meant was instead of it being placed in the backup script itself where it runs fine already for others without it, this makes more sense to modify the optional code of the cron than making it a permanent change to the main.

Tylerjet avatar May 02 '24 21:05 Tylerjet

This issue is stale because it has been open for 14 days with no activity.

github-actions[bot] avatar May 17 '24 01:05 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar May 31 '24 01:05 github-actions[bot]