-
-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Include the OS release info in backup directory names #780
base: m_778
Are you sure you want to change the base?
Conversation
Regarding this ...
... I'll check the other possible option: including the old ones. Probably tomorrow. Stay tuned. |
Appreciate this PR. It's very useful to include the OS release in the backup path name. Unfortunately I'm busy testing the next release 0.7.0 and therefore don't accept the PR as of now. Please be patient. I'll accept the PR when I finished my tests for next release and then add this nice PR |
I'm still working on some implementation details of this PR. |
It's done. As far as I can tell... (Edit-1: ROFL! It's never done!) The old backups without OS release info in its name are re-included into recycling strategy again. But considering the current discussion in https://forum-raspberrypi.de regarding partitionbased backups and their handling during recycling it might be an idea to
Of course that's another story. Edit-2: In the meantime the strategy has been changed. Old-type backups are old backups. Let them alone! |
A user message will follow soon. Improve getOSRelease to make it more robust.
So, since in the meantime the strategy had been changed (again) it's now like this: Old-type backups (without OS-release info in its name) are old backups. But there is a - hopefully - clear message for the user about them: They can be deleted manually. I used and created new MSG_ messages for writeToConsole as good as I could. |
I frankly thought to document this but usually docs are not read - so it's a very good idea to write a message to inform about this change.
No worries - I also have added some new messages. Message numbers can be updated very easy 😉 |
I enhanced the message about the directory name change by referring to a raspiBackup version number. |
Commit 778ffc6 (Fix some indentation inconsistencies) above isn't exactly related to this topic here. But it slipped in... |
Please update raspiBackup7412Test.sh in the test directory to use the new backup directory name. Don't fiddle with the tests ❗ . It created a lot of headache to create them and I don't want you to get the same headache 😉 . Just make sure they succeed with the new backup directory name. Would be great if you can make the test to run also on another more powerful Linux system. I executed this test on my desktop instead of a Raspberry. |
At least raspiBackup7412Test.sh is running now - without complaints. For now I won't continue with that test script. Other parts seem to be more important. |
That's what I expected: You had to update the directory name only and not to change anything in the test logic. I agree it's complicated code. But the test now finishes again successfully and that's important because you updated the SR code and we have to make sure the SR code still works correctly 😉 |
Get getOSRelease by sourcing raspiBackup.sh. Add test to check for NOT deleting old-named backups. And some smaller changes.
echo "$DEFAULT_REPORT_COUNTER" > "$report_counter_file" | ||
return | ||
fi | ||
rf=( $(<$report_counter_file) ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the reason you use rf=( $(<$report_counter_file) )
instead of just rf= $(<$report_counter_file)
to read the file contents? I see no reason to use an array here.
if (( $rfn > 0 )) ; then | ||
writeToConsole $MSG_LEVEL_MINIMAL $MSG_OLD_NAME_BACKUPS_COUNTER_INFO "${rfn}" | ||
else | ||
writeToConsole $MSG_LEVEL_MINIMAL $MSG_OLD_NAME_BACKUPS_COUNTER_INFO_BYE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's kindly to say good bye 😄 . But I would just stop the report without any message. That's also done by the restore test reminder and then raspiBackup reminders work consistently.
Adding to issue #778 this is my attempt implementing a different naming scheme of the backup directories which includes the OS version.
Using
instead of
This way every time a new OS version is saved a new backup directory is created/used and thus a new full backup is created.
Possibly already existing backups with the old name (without OS release info) are simply ignored during smartRecycle and while checking the number of backups to keep.
I successfully tested backup and restore in different configurations.