On-Site Client Automated Backup Script

On-Site Client Automated Backup Script

Onsite clients may request for automated backup scripts to be deployed on their servers for daily backups.

Deploy the below script on the clients server along with a specific cron-task setup for backups to be taken on a pre-defined time everyday.

Important Points to Consider
  1. The following script has been tested locally, but when you deploy on a clients environment make sure to test this again before adding into the live environment.
  2. A parameter (days) is defined where you can pass an integer, this will be used as a trigger point to remove backups that are old. I.E. if you set the days as 10, it will remove all backups which are 10 days older.
  3. A log file is maintained to log if a backup is completed/failed (you will have to define the path when deploying).
Inform the clients on the below:
  1. OrangeHRM will not be liable for any backups as we are only doing this as a help for the client but this is not our responsibility.
  2. If the backups are stored in the same server, client needs to make sure they move the backups to another location from time to time.
Change the following parameters as desired in the Clients' Environment;
  1.  MYSQL_ROOT - MySQL Root Password
  2. LOCAL_HOST - DB Local Host
  3. dateStamp - Parameter to store Today's Date
  4. dbName - DB Name
  5. backupName - DB Backup Name (dataStamp and dbName parameters above need to have values first)
  6. backupPath - Path in which the Backup will be stored
  7. days - Flag set to remove the backups after the define days are elapsed, this is done to remove older backups.
  8. A parameter on the mysqldump command has been hard-coded, please make sure to update this value with the actual DB Name on the (sed 's/`tmp_db`\.//g') section.
Cron-Task Example:
0 23 * * * cd /path/to/script/ && sh script_name.sh > /dev/null

    • Related Articles

    • SSL Certificate Updation - Onsite Clients

      This KB was generated with Volante Technologies in mind as the client has a minor difference in how they update these certificates on their side (Azure Front Door). The certificate validity shows correctly when checking on the browser, however, on ...
    • Enabling DOCX Resume Previewing Function on Recruitment Module

      On-Site Clients on older Versions (below 7.x) reported having trouble previewing Resumes/CV's on the Recruitment Module where the Candidate has uploaded them as a DOCX or any other format other than PDF. The solution for this issue was to install two ...
    • Client call scheduling etiquette

      It is required to adhere to the below options when scheduling meetings/sessions with your clients and stakeholders. This is not optional.  If it’s a meeting with one person, Calendar them for a particular time that suits you and email them and tell ...
    • Add doner in Gender Links instance

      Gender Links is a custom client. There can be a configuration request to "Add Doner", This needs to be added from the back end  1. Backup the database backup_db /var/www/html/OHRMStandalone/PROD/genderlinks/ 2. Insert the below query INSERT INTO ...
    • CCS Pay Rate Update

      CCS Pay Rate Update Client requests to update Pay Rates for their employees from time to time. As this was a frequent requirement a custom script was written to do this task to avoid the manual work. Client's requirement is to update the Pay Rates of ...