Backup via the console/ssh

My repetierServer runs on a pi4 with SSD. So far so good. Now I want to take care of the backup issue, the gcode, logs etc.

There is an extra program for this, I find that cumbersome, I would like to just backup to a mounted directory.

So in the worst case I set up a new image, activate it with my license and restore directory XYZ to the new server and I have the original state.

Is that how it works? If so, which directory do I need to backup?

THANKS

Comments

  • Everything is stores in /var/lib/Repetier-Server so that is the folder to backup. Thats actually what our Repetier-Server Monitor does with the possibility to select only parts. It makes a few zip files with the content. Also it handles unhooking databases etc. for backup.

    If you make it your self best make a script like
    #!/bin/bash
    sudo service RepetierServer stop
    tar -czf backuptarget.tgz /var/lib/Repetier-Server
    sudo service RepetierServer start

    Just note it will stop all runnign prints, so best call manually when all are idle. Don't make it a menu entry with external call either since shuting down server would kill server plus your script when it is started. You could do it with a trick only creating a file and in cron job you check if file exist and call it then so it is not running of the server.

  • Thanks for the info.

    So do the following steps:

    Make backup: 1. stop service, 2. make backup from /var/lib/repeat server directory, 3. start service.

    Restore system: 1. reinstall repeater server, 2. stop service, 3. restore backup

    Okay, so far clear. After that the system should be back with all gcodes, printers, logs etc. 

    But, if this is to be done automatically, there is no check at the beginning if there is a print job running.  Is there a simple way that I can query via script if a print job is running? Is there any file that is only there, a tmp file, when a just any de printer has a print job?
  • Not easily accessible. You can query status using our api and get a json with status of all printers and could get it from that, but in a script this is complicated.
    https://prgdoc.repetier-server.com/v1/docs/index.html#/en/web-api/websocket/basicCommands?id=list-printer

    describes the function i mean. If a job entry is not "none" it is printing. If you have unix socket enabled you can query without apikey locally.
Sign In or Register to comment.