Detect if LOCAL_BACKUP_DIR is not on / #41

Open
opened 2020-06-26 04:08:04 +02:00 by benpro · 1 comment
Contributor

Sometimes we use /home/backup mounted on a special block device dedicated to backup. Often simply /home partition.
But, if the mount point is not mounted, and there is no /home partition, /home/backup will be a folder on the root / partition.

We should detect that, example:

root@temp:/home# df -h /home/backup/
Filesystem      Size  Used Avail Use% Mounted on
/dev/vda1       109G  4.8G   99G   5% /

We can see that /home/backup is in fact /.

If we detect that, we should not do any LOCAL_TASKS and echo an error message that will appear in the cron output.

Internal reference: https://redmine.evolix.net/issues/4733

Sometimes we use `/home/backup` mounted on a special block device dedicated to backup. Often simply `/home` partition. But, if the mount point is not mounted, and there is no `/home` partition, `/home/backup` will be a folder on the root `/` partition. We should detect that, example: ``` root@temp:/home# df -h /home/backup/ Filesystem Size Used Avail Use% Mounted on /dev/vda1 109G 4.8G 99G 5% / ``` We can see that `/home/backup` is in fact `/`. If we detect that, we should not do any `LOCAL_TASKS` and echo an error message that will appear in the cron output. Internal reference: https://redmine.evolix.net/issues/4733
benpro added the
zzz_evobackup
label 2020-06-26 04:08:05 +02:00
Owner

Sur Linux on peut faire stat -c '%m' /home/backup et voir si ça retourne /.
Sur OpenBSD stat -f '%Sd' /home/backup.

On fait ça dans evomaintenance : https://gitea.evolix.org/evolix/evomaintenance/src/branch/master/evomaintenance.sh#L177

Sur Linux on peut faire `stat -c '%m' /home/backup` et voir si ça retourne `/`. Sur OpenBSD `stat -f '%Sd' /home/backup`. On fait ça dans evomaintenance : https://gitea.evolix.org/evolix/evomaintenance/src/branch/master/evomaintenance.sh#L177
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: evolix/evobackup#41
No description provided.