You are on page 1of 1

IES RIBERA DEL TAJO

DEPARTAMENTO DE INFORMÁTICA

Practice UT3: Scripts MariaDB – ASIR2 – ASGBD

 Exercises:

1. Create a Bash script that prompts for two numbers and displays the result of the larger
number on the screen.

2. Implement the same script, but within a function.

3. Develop a program that shows a menu with two options (greater and smaller). When
an option is chosen, it will prompt for two numbers and indicate which one is greater
or smaller. It should display a message in case they are equal. To finish, it will ask if
you want to exit. In case of a negative response, it will return to the initial menu, and
in case of an affirmative response, it will exit the program.

4. Create a script that performs a hot logical backup of all databases in MariaDB. It
should compress the backup based on the specified parameter and store it in a
directory named "completeBackups" with the resulting name containing the current
date. Finally, it should delete all files created more than the specified number of days
ago and send the compressed file to an email specified as a parameter.

5. Develop a script that performs a cold physical backup by grouping and compressing
all files and directories in the data directory. It should restart the system manager
service. It is mandatory to specify a valid destination for the final file location and
optionally provide an email to which the file will be sent if the size in megabytes does
not exceed a specified maximum parameter.

You might also like