This is the type of question that you could probably get answered using something like ChatGPT or Google Gemini. You have the information you want in your question, so what you need to do is write a prompt that will give you a suitable answer. For instance, you could use something like this as your prompt
I want to create a bash script to create a local copy of my MySQL database. Once the backup is created, the script will upload it to a network share. The backup needs to be retained for 7 days, after which point it will be removed.