Skip to content
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

Backup #119

Merged
merged 3 commits into from
Oct 26, 2024
Merged

Backup #119

merged 3 commits into from
Oct 26, 2024

Conversation

Nachtzuster
Copy link
Owner

No description provided.

@lloydbayley
Copy link

Just tested this. Seemed to work well, however, on restore, the birds.db has the wrong permissions. Should be 666 but restored as 644. Found this by trying to delete a recording after restoring. Gave a read only error.
Manually changed to 666 and things worked again.
I'm pulling an all-nighter to try to fix my sleeping patterns so I won't attempt any difficult code fixes just now!

@lloydbayley
Copy link

Ok. Adding a -p to the restore tar command seems to fix it! Although, with lack of sleep, I may not be able to be trusted!

@alexbelgium
Copy link

Looks a really nice feature, thanks !

restore() {
log "Starting restore"
for obj in "${objects[@]}";do
tar --extract - p -f "$ARCHIVE" -C "$(dirname "$obj")" "$(basename "$obj")"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a space between - and p that shouldn't be there...

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doh!

@Nachtzuster Nachtzuster marked this pull request as draft June 29, 2024 18:50
@Nachtzuster Nachtzuster force-pushed the backup branch 2 times, most recently from e1dc766 to 62ed4a6 Compare July 9, 2024 16:11
@Nachtzuster Nachtzuster marked this pull request as ready for review October 20, 2024 13:26
@alexbelgium
Copy link

Nice feature thanks !

@Emmo213
Copy link

Emmo213 commented Oct 29, 2024

bzipping would provide smaller backup files.

tar -cjf birds.tar.bz2 scripts/birds.db
-rw-r--r--  1 birdnet birdnet 26808320 Oct 29 09:36 birds.tar
-rw-r--r--  1 birdnet birdnet  2314723 Oct 29 09:37 birds.tar.bz2

@Nachtzuster
Copy link
Owner Author

I did consider compression briefly, however mp3 and png files, the biggest part of an actual backup by a large margin, are not compressible. Even the birds.db database, the only notable file that would be worth compressing, is dwarfed by these.
Using compression would not result in any smaller backup file, but would cost lots of cpu cycles, hence time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants