Tags: Staubgeborener/Klipper-Backup
Tags
Couple updates/ Additional checks (#30) * remove random white space, as well added -f to git push ensuring that any push is forced, *this removes some errors about failing to push refs to your repository due to the remote containing files that you don't have locally which we can ignore * Add check for if and exit while informing the user that the backup folder cannot be the root directory of /home/{username}/, created a backup_path variable within script.sh as there were 5 plus areas where the same was being used so having a variable that you only need to change once to change all of them seems better, removed a random white space, as well added -f to git push ensuring that any push is forced, *this removes some errors about failing to push refs to your repository due to the remote containing files that you don't have locally which we can ignore, added some additional checks for proper file and folder removal after the backup is pushed ensuring that most situations or folder design is handled. * added a few more examples to backup location and adjusted notes for backup folder syntax * updated a few lines spacing, along with additional checks and adjustments to a few variables and additional git commands to ensure existing repos are pulled in properly. * spacing at line 53 and 55 * remove $ line 16 * add check for when backing up and entire folder ensure that /* is in the path or else cp -r will not correctly check the individual files * also added check for individual files as it was adding /* to individual files syntax * now properly checks if the path found in .env is a folder and proceeds to check if /* is included, if not append /* so that file copy fucntions properly. * comment change, and forgot to place some parts that were missing * copied files/folders should now properly keep directory structure, removed checks for backup_folder length and content as removed it from .env and is now set in the script (backwards compatible change as the hardcoded variable will always overwrite the path for backup_folder found in .env) --------- Co-authored-by: Staubgeborener
Fixes Issue #6 , Improvements, Changes, Added Feature (#24) * removed version file as to update you can either git pull in the repository folder or add the repo to moonraker update manager, modified install script pretty much all it does now in terms of installing is making sure that .env.example is turned into .env for the user. modified script and .env to use as minimal hardcoded paths as possible ensureing that any home path that might not be on the user of pi should now work, as well moved the backup location to its own folder instead of storing in the repository which ensures that moonraker does not see the repo as dirty * uncommented github upload as all other tests passed * ensuring that updates to this repo still work properly, changed date format to M-D-Y for commit messages * check if pc timezone is set to America and use US date formatting else use original date stamp for commit messages * Update README.md * Update README.md Perfect the software update section sees those changes and prompts as expected! * Delete install.sh Removing install.sh as its sort of redundant since all it does is the command `cp .env.example .env` which could just be done with an && right after git clone. * Update README.md Add install instructions * remove extra / for backup folder and config path, which now allows for the script to ignore read only files that should not have edits like KAMP, fluidd.cfg, mainsail.cfg. updated script.sh to remove the local backup files after upload so that any deletions can be logged on next backup. * Update README.md * Update README * add global default branch git command to remove the warning about branch changes, and the git branch -M main as its now not needed. Removed a debug line in script.sh along with adding code to ignore the additional printer.cfg backups that fluidd like to make multiples of to remove exce 7759 ss clutter from the backup. * format of printer backup configs was incorrect should have been an underscore not a dash near the end * Update README.md * update url * remove /* from for loop in script.sh as it boke indidual path searching, instead placed into folder path syntax so its only seen when specfically searching through a folder only * don't really need --global as can just set the local git config to keep the error from showing. Removed extra newline near top os script.sh * update readme * added back in one file path example for those who may want to use that method instead of backing up the entire config folder * realized i no longer needed eval, just needed to remove the quotes around the variables and runs fine. * added commend to descript what second elif is doing after skipping symbolic links, -u and --set-upstream were the same parameter chose one and removed the other * Use source to grab all variables from .env in one go instead of using grep and sed parse the data. Check if .git exists in backup directory so that we only initialize the git repository once and don't continuously reinitialize on subsquent runs. FEATURE ADD: Commit username and email. You can now set a custom commit username and email if left blank the username will be the current user running the script ('whoami') and email is ('whoami')@('hostname --long') * revert links back to https://github.com/Staubgeborener/klipper-backup, final push to test main for PR * didn't update .env.example, now i can test * Push V1.0.0 tag as well as commiting a extra whitespace to check moonraker updates * adjust README.md to match requested change from Staubgeborener. fix issue found with git init sill trying to use master the branch name is now definable in .env, as well as setting the default branch directly in the config file before initializing. If .git already exists grab the branch name and use that instead. * no need to cd into .git just echo to .git/config * Just updated the comments for folder syntax to be a bit more clear and show examples of setup/explaination --------- Co-authored-by: Tyler's Neptune 4 Pro <mks@mkspi.local.lan>
PreviousNext