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

Support for btrfs snapshotsSnapshots #829

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

DBa20-24
Copy link

@DBa20-24 DBa20-24 commented Jan 14, 2025

How this change works:

  • the "snapshot_pre" extension:
    • sets "SNAPDEST" variable to /.snapshot-raspiBackup-$BACKUPFILE
    • stops the services (getting the list of commands from the STOPSERVICES variable, this the change to export it!),
    • creates a snapshot (in $SNAPDEST)
    • starts the services again (getting commands from STARTSERVICES variable)
    • and changes "STARTSERVICES" variable to snapshot deletion and empties the "STOPSESRVICES" variable to prevent the services from being stopped again
  • (it should also check the USE_FS_SNAPSHOTS command to skip above actions if it is not set - this is for the next change)

The main script:

  • accepts "--snapshot/--snapshots" to activate the new functionality (sets USE_FS_SNAPSHOTS)
  • when mounting a filesystem for backup, checks the FS type
  • if a btrfs is encountered and USE_FS_SNAPSHOTS activated and SNAPDEST is set (i.e. extension is loaded), an additional mount option is passed to the mount command: "subvol=$SNAPDEST", which mounts the snapshot rather than the live filesystem
  • everythign else pretty much unchanged

@framps framps self-assigned this Jan 14, 2025
@framps framps self-requested a review January 14, 2025 18:19
Copy link
Owner

@framps framps left a comment

Choose a reason for hiding this comment

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

I had various comments. Please check 😉

@framps
Copy link
Owner

framps commented Jan 14, 2025

You added raspiBackup.sh.swap in your PR. Please remove this file.

@DBa20-24 DBa20-24 requested a review from framps January 15, 2025 05:54
Copy link
Author

@DBa20-24 DBa20-24 left a comment

Choose a reason for hiding this comment

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

Swap file removed

@DBa20-24
Copy link
Author

There was a typo, corrected now

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.

2 participants