Most of the sites rely on codebase & database which we can't afford to lose. We definitely need to implement a backup procedure in that case, otherwise, we may lose our valuable data due to some kind of mishap (manually delete some data by mistake, software errors, hardware errors, server compromise, etc).
We can use the following shell script to make a backup (codebase and database).
First, let's create the backup script file:
and add the following code: