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"
|
||||
fi
|
||||
|
||||
|
||||
# Mount disk
|
||||
echo "Mounting disk..."
|
||||
mount UUID="$disk_UUID" "$backup_path"
|
||||
if mountpoint -q "$backup_path"; then
|
||||
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
|
||||
|
||||
|
||||
# The disk not mount
|
||||
# Check the disk not mount
|
||||
if ! mountpoint -q "$backup_path"; then
|
||||
echo "Error occurred when mounting disk. Aborting..."
|
||||
exit 1
|
||||
|
Loading…
x
Reference in New Issue
Block a user