-
Couldn't load subscription status.
- Fork 9
Create last_update_export.py #23
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
base: main
Are you sure you want to change the base?
Conversation
This script is designed for use in a "disconnect" environment. The host server is to do daily exports based on last build of a channel. This script looks at the list of channels, gets the ChannelLastBuildByID and checks if the date is the current date or prior and then exports that channel. Logging is provided as well to show which channels were updated in that export. The target server can then rsync the `/mnt/export` directory and run another script to execute the inter-server-sync import of the exported data.
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.
Thanks for this contribution!
I've added few comments that I hope it helps to get the script in shape to get merged.
Updates from the source since uploading to uyuni-tools, multiple iterations to streamline have occured. Updates include fixes from comments and further use, which include... 1) script header 2) better path management and configurable parameters 3) use of shutil.rmtree avoiding extra calls to subprocess 4) configurable days for export 5) configurable user/group 6) added the use of mgr-sycn credentials file instead of using username/password in the script.
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.
Thanks for the changes! This is looking better now! Still I added some comments after your latest changes, maybe you can have a look.
updated the constants and variables, and changed the order they appear in the script
caught the datetime.date.today()
Co-authored-by: Pablo Suárez Hernández <[email protected]>
removed the shell=True from the subprocess.run command, missed that from the last commit after updating the command
Fixed the shebang line
fixed the command execution
updated script header to be better formatted and easier to read.
This file is part of the last_update_export.py script put forward. This file is for the initial export using the ISSv2 used in a disconnected or air-gapped environment, to do a full export instead of an incremental export as the last_update_export.py, it can also be used to add a new product channel to an air-gapped system.
|
Sorry for the late reaction. |
|
These scripts were not designed for the containerized version of SUMA. I will have to work on this. |
This script is designed for use in a "disconnect" environment. The host server is to do daily exports based on last build of a channel. This script looks at the list of channels, gets the ChannelLastBuildByID and checks if the date is the current date or prior and then exports that channel.
Logging is provided as well to show which channels were updated in that export.
The target server can then rsync the
/mnt/exportdirectory and run another script to execute the inter-server-sync import of the exported data.