The main task for this script is to maintain linux server up-to-date by installing the latest updates on itself.
To do this, you need to place this script somewhere in the linux server, I recommend you to do it in the /root directory, add root permissions to read and execute:
chown root:root updater.sh # set root as the owner
chmod 500 updater.sh # set read and execute permission
...and set the cronjob to run this script every day:
# crontab -u root -e
@daily /root/updater/updater.sh
On very first run it creates a logs
folder in the main directory that you specified in the bash file. In the logs folder will be stored logs of the update, what's installed and all the errors if there is any.