I use an USB HDD for the backup. Because the HDD is mounted only during the backup I can’t see how much space is left. Is there a possibility to make this information visible in the dash board?
I know how I can get the information via CLI but this is a work I like to prevent. Start Putty, login, mount the USB HDD, check the space, umount the HDD and log out.
Adding a line with usb disk space usage at the bottom of the email backup report could be a valid workaround? That would be easy.
Something like:
===== Report for data backup =====
Backup started at 2015-10-21 01:00:16
Pre backup scripts status: SUCCESS
Post backup scripts status: SUCCESS
Backup status: SUCCESS
Backup ended at 2015-10-21 01:49:20
Time elapsed: 0 hours, 49 minutes, 4 seconds
Disk usage:
Size Used Avail Use%
2.7T 2.3T 413G 85%
This seems a “junior” job that could be used as a developer training test.
Let’s start with the analysis.
Are we going to implement only disk usage only in the email, only in the dashboard or both?
how could we show it in the email?
and in the dashboard?
The backup process is split in 3 steps:
pre-backup to dump db and mount backup destination
data copy
post-backup to clean db dumps and unmount
I’d add an action to the pre-backup phase to “record” somewhere disk usage after mount.
Then, we need to find a way to insert the information in the email report and the dashboard.
Caution: the disk usage on the dashboard is recorded at time of backup, it’s not calculated when you login to the dashboard.
Also, we could add the action in the post-backup instead of pre-backup to report disk usage after the backup (maybe is better).
Those are the first things that came to my mind, any other issue I may have forgotten?
Any more hints?
I would do it after the backup because this is the information the admin will need.
The dashboard is for me the place where all necessary information about the server situation should be visible. If an email report is send than it should be in there as well.
I think it is for the normal backup but it can be for both Normal and config
I’ll have to think about the logic for this so it will be ok and not "complicated/clumsy "
Maybe if @filippo_carletti will have some time in the evenings we can solve this issue quickly.
Hi @filippo_carletti, Is the storage mounted before the bkp and unmounted after ?
Because if it is always mounted is a simpler solution then the later.
Hi @Ctek
as fare as I know is the storage mounted only during the back up.
At the moment I work via CLI and mount my USB drive, check the space and umount it again.
Hi NAS, this is one solution.
Another (the one I’m looking into now) is to have the setting for the volume that is holding the backups read from the db, then see the free space of that volume.
After the info of free space in the Dashboard is updated, the volume is released.
This will make the information more “live” and accurate, but it will pose the problem of mounting/unmounting the volume every time you access the Dashboard.
I took this into account because in the method you specified, the read is from a file that was created at the moment of the backup, and a lot can change on the target volume from then until the new backup. (files can be added to that volume and space can decrease).
So a more frequent read of that volume’s free space seems more logical to me.
Since the target device should be used for backup only, I think that a script inside the post-backup is enough accurate.
Tomorrow I would like to give a try to Filippo proposal.
If it works, I could share step-by-step tutorial how to integrate it.