From 5f6aa99a68d4149ba7fabc1428c8b527ebdca280 Mon Sep 17 00:00:00 2001 From: paukstelis Date: Mon, 28 Nov 2022 17:36:48 -0500 Subject: [PATCH] allow backup of generic as 'octoprint' --- README.md | 1 + octoprint_deploy.sh | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c001df8..12332a3 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,7 @@ These files provide a bash script for quickly deploying multiple octoprint insta * Change udev rules for an instance with `sudo octoprint_deploy/octoprint_deploy.sh replace` * Always a good idea to update octoprint_deploy from time-to-time with `git -C octoprint_deploy pull` # Recent Changes +* Allow making backups of generic instance. * Add 'noserial' command line option. Currently for cameras only, this will unset the serial number in cases where cameras are known to share a serial number. * Add detection for ch34x driver. This is used by Weedo printers and must be compiled separately. * Utility sub-menu for less used options. diff --git a/octoprint_deploy.sh b/octoprint_deploy.sh index 76cbe7f..6fff684 100755 --- a/octoprint_deploy.sh +++ b/octoprint_deploy.sh @@ -389,7 +389,7 @@ add_camera() { if [ -z "$PI" ]; then detect_camera - if [ -n "$NOSERIAL" ]; then + if [ -n "$NOSERIAL" ] && [ -n "$CAM" ]; then unset CAM fi #Failed state. Nothing detected @@ -1075,7 +1075,7 @@ create_menu() { options+=("Quit") select opt in "${options[@]}" do - if [ "$opt" == Quit ] || [ "$opt" == generic ]; then + if [ "$opt" == Quit ]; then main_menu fi @@ -1196,6 +1196,9 @@ share_uploads() { back_up() { INSTANCE=$1 echo "Creating backup of $INSTANCE...." + if [ "$INSTANCE" == generic ]; then + INSTANCE="octoprint" + fi d=$(date '+%Y-%m-%d') sudo -p $user tar -czf ${INSTANCE}_${d}_backup.tar.gz -C /home/$user/ .${INSTANCE} echo "Tarred and gzipped backup created in /home/$user"