How to update an existing file size created in the database through file paths with laravel-react

i’m saddled with the responsibilities of debugging a Backup Watcher software developed with Laravel-React. What the software does is to watch if the backup software (cobian backup software) used by the company completes the daily backup of the company workfiles.

The backupWatcher software confirm the completion of backups by checking if the workfile size is equal to the backup size in the database.

Everything works smoothly with the software but the only dilemma is that once the workfiles size is created in the database, it doesn’t update when the unit folder increases. Lets say, the workfile size of a particular unit when created in the database is 10GB and later the folder increases to 15GB, the database won’t get updated. So the software will only compare the backup size with the outdated workfile size in the database yielding wrong result.

Now i want to create a ‘Refresh workfile size’ button so that when the button is clicked, the workfiles size in the database can be updated or if there is a way the workfile sizes can be updated automatically as the units folder are increases

Axios was used with react to insert workfile size to the database , i’m just above beginner level in Laravel and React. Please what’s the way out?

What you need is to get a route that points on said file. After that is rather easy getting file size and writing a snippet that stores size data to db. You then can achieve this either by intentional update i.e “on click” of sorts, or you can make “schedule” that checks for previously said. Scheduling docs.