How To Automatically Run MySQL Dump in Windows and Linux to Backup MySQL Database
Windows
- Create a batch file “sweetcoc_ams_backup.bat” for mysqldump. Copy below code into the batch file:-
@echo off REM set mysqldump path SET mysqldump_path="C:\wamp64\bin\mysql\mysql5.7.26\bin\mysqldump.exe" REM credentials to connect to MySQL server SET mysql_user=root SET mysql_password= REM backup storage location SET backup_folder="C:\wamp64\www\database_backups" REM backup file name SET backup_name=%backup_folder%\sweetcoc_ams_%DATE:~-4%-%DATE:~7,2%-%DATE:~4,2%.sql REM create backup "C:\wamp64\bin\mysql\mysql5.7.26\bin\mysqldump.exe" -u %mysql_user% sweetcoc_ams > %backup_name% - Create a new Task Scheduler that executes the batch file.




Linux
- Create a new PHP file and copy below code into it.
<?php ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL); $database = '*****'; $user = '*****'; $pass = '*****'; $host = '*****'; //$dir = dirname(__FILE__) . '/dump.sql'; $dir = dirname(__FILE__); echo "Backing up database to {$dir}."; echo "\n"; exec("mysqldump --user={$user} --password={$pass} --host={$host} --no-tablespaces {$database} | zip > \${HOME}/database_backup/{$database}_`date '+%Y-%m-%d_%H:%M'`.sql.zip", $output); echo "\n"; echo "Backup completed."; ?> - Create a new Cron Job and point to the path where the PHP file is saved.
/usr/local/bin/php
/home4/sweetcoc/database_backup/mysqldump.php - The Cron Job will save the database as below:-

Restoring a Back-Up Database
- Go to “D:\” drive in UBS-SERVER.
- Compress “AMS Back-Up” folder to “AMS Back-Up.zip”.

- Copy “AMS Back-Up.zip” into “C:\wamp64\www\” folder in HP-6305-W7PRO and extract it.
- After extracted, move all folders inside “AMS Back-Up” folder to the root folder of “C:\wamp64\www\”. The folder hierarchy should be as below:-

- Go to “Start”, search for “wampserver” and run “Wampserver64”.

- Wait and ensure the icon is green in “System Tray” that indicates all services are running.

- If not then click on “Wampserver64” icon and select “Restart All Services”.

- Click on Windows “System Tray” dropdown -> click “Wamserver64” icon -> click “phpMyAdmin”. “phpMyAdmin” will be opened on the browser.

- Enter the “username = root” and leave the password empty. Click “Go”.

- Click on “sweetcoc_ams” database -> click “Import”.

- Click “Choose file”.

- Browse “C:\wamp64\www\database_backups”, sort the files by “Date modified” and open the latest SQL file.

- Leave everything as it is and click “Go”.

- Go to browser and open “http://localhost/punchcard”.

- Finally HP-6305-W7PRO” will have the latest version of “E-Punch Card” and “sweetcoc_ams” database.
How to Set Automatic Power On After Power is Resumed in BIOS
| BEFORE | AFTER | REMARK |
| Set to reboot after power has restored by TNB.
source: https://support.hp.com/gb-en/document/ish_3912651-2318005-16 |
How to Upgrade SERVERLINK
- Firstly, create a restore point.

- Open SERVERLINK, in “HOME”, click on the update.

- Let SERVERLINK download the update.
- After the download has been completed, a popup will appear. Click “Yes”.

- Click “Next” on each Setup.

Note: if you choose “Only dowload setup (do not install)” , then the setup file is downloaded into this folder “C:\Users\…\AppData\Local\Temp\UpdateRelease.exe“. Run the “UpdateRelease.exe” at a later date.
- Restart UBS-SERVER.

- Finally, check the version displayed is the latest version (s.c.).

Comparison of E-mail API used in PHP
| Runner_Mail() | PHPMailer() | PHP Mail() |
| SMTP, user name, password, port, etc. are set inside the PHPRunner UI | PHPMailer() is called by Runner_Mail()
SMTP is set inside the PHP code itself |
SMTP is set in “PHP.ini” |
| <?php
require_once(“include/dbcommon.php”);
$email = “t1@mobitek.my”; $msg = “”; $subject = “New data record”;
$msg.= “Message: [Message]\r\n”; $msg.= “Recipient: Recipient\r\n”; $msg.= “Date/Time: DateTimeQueue\r\n”; runner_mail(array(‘to’ => ‘$email’, ‘subject’ => $subject, ‘body’ => $msg)); ?> |
<?php include_once(‘libs/phpmailer/class.phpmailer.php’); include_once(‘libs/phpmailer/class.smtp.php’);$mail = new PHPMailer( true ); // Mail settings $mail->isSMTP(); //Send using SMTP $mail->Host = ‘mail.sweetco.com.my’; //Set the SMTP server to send through $mail->SMTPAuth = true; //Enable SMTP authentication $mail->Username = ‘factory@sweetco.com.my‘; //SMTP username $mail->Password = ‘2022@Beranang@Factory’; //SMTP password //$mail->SMTPSecure = PHPMailer::ENCRYPTION_SMTPS; //Enable implicit TLS encryption $mail->Port = 587; //TCP port to connect to; use 587 if you have set `SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS` $mail->setFrom(‘support@mobitek.my‘, ‘MOBITEK Support’); $mail->isHTML(false);$mail->To = “t1@mobitek.my”; $mail->Subject = “This is Subject”; $mail->Body = “This the body”; $mail->Send();?> |
Open “php.ini” and search for “smtp” (there are no entries for no username and password)
[mail function] ; For Win32 only. ; For Unix only. You may supply arguments as well (default: “sendmail -t -i”). ; Force the addition of the specified parameters to be passed as extra parameters ; Add X-PHP-Originating-Script: that will include uid of the script followed by the filename ; The path to a log file that will log all mail() calls. Log entries include |
MOBITEK Q25 4G Modem Can Use IP Address instead of COM Port Number
| TEST OBJECTIVE | TESTING METHODOLOGY | TEST RESULT |
| Can hyper terminal connect to MOBITEK Q25 4G Modem via IP address instead of COM port and run “hyper terminal test“? |
|
How to Implement Log-In Page using “Database” for a Web Application
- Edit “Email settings…” in “Misc” tab.

- Add new table “users” in “Security” tab.

- Set “Dynamic permissions” in “Security” tab. Add a new user.


- Build and run the PHPRunner project in localhost. Log in using the username and password added previously. Let the PHPRunner project open in localhost.
- Go to PHPRunner project again. Enable “Password hashing (encryption)” in “Registration and passwords…”.

- Build and run PHPRunner project again in localhost.
- Go to “Admin Area”.

- Go to “Add/Edit users”, edit the password. To use back the same password, first change the password to another password. Save it and then edit it back to change to the original password.

MOBITEK Q25 Can Use Internet Application and Send SMS at the Same Time
| TEST OBJECTIVE | TESTING METHODOLOGY | TEST RESULT |
| Can MOBITEK Q25 connect to internet and send out SMS at the same time? |
|
TEST 1
TEST 2 |
USR-VCOM for MOBITEK S80 and MOBITEK Q25 Works in Windows 11
LAN driver (USR-VCOM) for MOBITEK S80 and MOBITEK Q25 supports Windows 11.
However, the USB driver of MOBITEK S80 3G Modem does not work in Windows 11. Use LAN port (LAN driver) of MOBITEK S80 instead.
USR-VCOM for MOBITEK S80 and MOBITEK Q25 Works in Windows 11
| TEST OBJECTIVE | TESTING METHODOLOGY | TEST RESULT |
| Does MOBITEK S80’s USR-VCOM (ELTIMA virtual serial port) support Windows 11? | USR-VCOM version = 3.7.1.520 | |
| Does MOBITEK Q25’s USR-VCOM (ELTIMA virtual serial port) support Windows 11? | USR-VCOM version = 3.7.1.520 |


































