Most of the sites rely on codebase & database which we can't afford to loose. We definitely need to implement a backup procedure in that case, otherwise we may loose 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 backup (codebase and database).
First let's create the backup script file:
and add the following code: