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

flatcar-reset: Add backup and preview #94

Merged
merged 1 commit into from
Apr 4, 2023
Merged

Conversation

pothos
Copy link
Member

@pothos pothos commented Mar 28, 2023

When users run flatcar-reset from the command line to try it out, this should not result in data loss when they forget to quote the keep paths correctly or didn't know how to stop the staged reset. Add a warning and the option to see the list of files in preview. Also add the option to do a backup when staging a reset. The backup does not cover ACLs because Flatcar's rsync isn't compiled with support for them.

How to use

Improve our rsync to support ACLs even though most people don't use them

Testing done

Copied it over manually to a VM at /home/core/flatcar-reset

touch myfile
sudo ./flatcar-reset --preview-keep --keep-paths /etc/ssh /home/core/flatcar-reset
sudo ./flatcar-reset --preview-delete --keep-paths /var/log /home/core/flatcar-reset
sudo ./flatcar-reset --backup --keep-paths /home/core/flatcar-reset # takes some time because of the checks to correctly preserve the directory structure
sudo reboot
ls myfile # does not exist
sudo ./flatcar-reset --restore-backup
ls myfile # exists again

@pothos pothos requested a review from a team March 28, 2023 11:23
Copy link
Member

@rata rata left a comment

Choose a reason for hiding this comment

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

Thanks A LOT for this PR. I really think this is super useful.

When users run flatcar-reset from the command line to try it out, this
should not result in data loss when they forget to quote the keep paths
correctly or didn't know how to stop the staged reset.
Add a warning and the option to see the list of files in preview. Also
add the option to do a backup when staging a reset. The backup does not
cover ACLs because Flatcar's rsync isn't compiled with support for
them.
@pothos pothos force-pushed the kai/reset-backup branch from ab13c01 to fc20edd Compare March 29, 2023 11:36
@pothos
Copy link
Member Author

pothos commented Apr 4, 2023

I would merge this soon if there are no other comments

@pothos pothos merged commit 17224c8 into flatcar-master Apr 4, 2023
@pothos pothos deleted the kai/reset-backup branch April 4, 2023 15:08
pothos added a commit to flatcar-archive/coreos-overlay that referenced this pull request Apr 4, 2023
This pulls in flatcar/init#94
to prevent data loss by having a preview mode and a backup/restore
option.
t-lo pushed a commit to flatcar/scripts that referenced this pull request Apr 17, 2023
This pulls in flatcar/init#94
to prevent data loss by having a preview mode and a backup/restore
option.
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.

3 participants