mirror of
https://github.com/Facundo-prog/automatic_backup_script.git
synced 2025-10-14 00:59:40 +00:00
Update backup-files.sh
Already mount disk error fixed
This commit is contained in:
parent
1e91bbdd45
commit
b9c8235955
@ -54,13 +54,19 @@ if [ ! -d "$backup_path" ]; then
|
|||||||
echo "Mount point disk created"
|
echo "Mount point disk created"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
# Mount disk
|
# Mount disk
|
||||||
echo "Mounting disk..."
|
if mountpoint -q "$backup_path"; then
|
||||||
mount UUID="$disk_UUID" "$backup_path"
|
echo "$backup_path is already mounted."
|
||||||
|
mounted_src=$(findmnt -n -o SOURCE --target "$backup_path" 2>/dev/null || true)
|
||||||
|
echo "Mounted source: ${mounted_src:-unknown}"
|
||||||
|
else
|
||||||
|
echo "Mounting disk..."
|
||||||
|
if ! mount UUID="$disk_UUID" "$backup_path"; then
|
||||||
|
echo "mount returned non-zero. Checking mountpoint..."
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check the disk not mount
|
||||||
# The disk not mount
|
|
||||||
if ! mountpoint -q "$backup_path"; then
|
if ! mountpoint -q "$backup_path"; then
|
||||||
echo "Error occurred when mounting disk. Aborting..."
|
echo "Error occurred when mounting disk. Aborting..."
|
||||||
exit 1
|
exit 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user